-
public interface ElementComparator
An index-based comparator for aTokenSequence
. AnElementComparator
always exists in the context of aTokenSequence
; indexes refer to this sequence.
-
-
Field Summary
Fields Modifier and Type Field Description static int
EQUALS
A value indicating the left value was equal to the right valuestatic int
GREATER_THAN
A value indicating the left value was greater than the right valuestatic int
LESS_THAN
A value indicating the left value was less than the right value
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareElements(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:
0
if the values are equal,1
if the left elements value is greater,-1
if the left elements value is lesser. A null value is greater than any other non-null; two null values compare as equal.
-
-