-
public interface ElementComparatorAn index-based comparator for aTokenSequence. AnElementComparatoralways exists in the context of aTokenSequence; indexes refer to this sequence.
-
-
Field Summary
Fields Modifier and Type Field Description static intEQUALSA value indicating the left value was equal to the right valuestatic intGREATER_THANA value indicating the left value was greater than the right valuestatic intLESS_THANA value indicating the left value was less than the right value
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareElements(int lhsIndex, int rhsIndex)Compares two sequence elements, specified by index.
-
-
-
Field Detail
-
LESS_THAN
static final int LESS_THAN
A value indicating the left value was less than the right value- See Also:
- Constant Field Values
-
EQUALS
static final int EQUALS
A value indicating the left value was equal to the right value- See Also:
- Constant Field Values
-
GREATER_THAN
static final int GREATER_THAN
A value indicating the left value was greater than the right value- See Also:
- Constant Field Values
-
-
Method Detail
-
compareElements
int compareElements(int lhsIndex, int rhsIndex)Compares two sequence elements, specified by index.- Parameters:
lhsIndex- the index of the left hand element in the comparisonrhsIndex- the index of the right hand element in the comparison- Returns:
0if the values are equal,1if the left elements value is greater,-1if the left elements value is lesser. A null value is greater than any other non-null; two null values compare as equal.
-
-