public interface ElementComparator
An index-based comparator for a
TokenSequence.
An ElementComparator always exists in the
context of a TokenSequence; indexes refer
to this sequence.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA value indicating the left value was equal to the right valuestatic final intA value indicating the left value was greater than the right valuestatic final intA value indicating the left value was less than the right value -
Method Summary
Modifier and TypeMethodDescriptionintcompareElements(int lhsIndex, int rhsIndex) Compares two sequence elements, specified by index.
-
Field Details
-
LESS_THAN
static final int LESS_THANA value indicating the left value was less than the right value- See Also:
-
EQUALS
static final int EQUALSA value indicating the left value was equal to the right value- See Also:
-
GREATER_THAN
static final int GREATER_THANA value indicating the left value was greater than the right value- See Also:
-
-
Method Details
-
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.
-