Class IntegerComparisonTerm

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MessageNumberTerm, SizeTerm

public abstract class IntegerComparisonTerm extends ComparisonTerm
This class implements comparisons for integers.
Author:
Bill Shannon, John Mani
See Also:
  • Field Details

    • number

      protected int number
      The number.
  • Constructor Details

    • IntegerComparisonTerm

      protected IntegerComparisonTerm(int comparison, int number)
      Constructor.
      Parameters:
      comparison - the type of comparison.
      number - the number to compare with.
  • Method Details

    • getNumber

      public int getNumber()
      Return the number to compare with.
      Returns:
      the number
    • getComparison

      public int getComparison()
      Return the type of comparison.
      Returns:
      the comparison type
    • match

      protected boolean match(int i)
      Match against the argument i.
      Parameters:
      i - the integer to match
      Returns:
      true if given integer matches this comparison; otherwise false
    • equals

      public boolean equals(Object obj)
      Equality comparison.
      Overrides:
      equals in class ComparisonTerm
    • hashCode

      public int hashCode()
      Compute a hashCode for this object.
      Overrides:
      hashCode in class ComparisonTerm