public interface TokenComparator
TokenValued
,
implementations are type specific, working on only tokens of one type
(or, in the case of the number types, any number type).TokenComparators
Modifier and Type | Method and Description |
---|---|
int |
compare()
Indicates the relative ordering of two token values.
|
boolean |
equal()
Indicates whether the currently bound values are equal.
|
TokenOrder |
getDirection()
Gets the direction of the comparator's ordering.
|
TokenType |
getType()
Gets the type of tokens for which the comparator is valid.
|
void |
setLeftSource(TokenValued source)
Binds the left-hand value of the comparator to the specified
object.
|
void |
setRightSource(TokenValued source)
Binds the right-hand value of the comparator to the specified
object.
|
TokenType getType()
TokenOrder getDirection()
void setLeftSource(TokenValued source)
source
- the value container to use on the left side
of comparisonsvoid setRightSource(TokenValued source)
source
- the value container to use on the right side
of comparisonsboolean equal()
true
if the bound values are equal,
false
otherwise.int compare()
"banana"
before
"apple"
, an inversion of the natural
(ascending) ordering.
Null valued tokens always compare equal under this
method. Note that this disagrees with the behavior
of equal()
.
Copyright © 2024 Actian Corporation. All rights reserved.