Package org.apache.uima.cas.admin
Interface FSIndexComparator
- All Superinterfaces:
Comparable<FSIndexComparator>
- All Known Implementing Classes:
FSIndexComparatorImpl
This interface describes objects which specify the comparison used in indexes for keys.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
Compare key1 of fs1 with key2 of fs2 so that the order of fs1 and fs2 is the reverse as that of key1 and key2 (with respect to the standard order of that key).static final int
Compare key1 of fs1 with key2 of fs2 so that the order of fs1 and fs2 is the same as that of key1 and key2 in the standard order for that kind of key.static final int
-
Method Summary
Modifier and TypeMethodDescriptionint
addKey
(LinearTypeOrder typeOrder, int compareKey) int
Add a new key.boolean
Test for equality against anotherFSIndexComparator
true
iff the comparators have the same keys and comparators.int
getKeyComparator
(int key) Get the comparator for this key.getKeyFeature
(int key) Get the feature for this key.int
getKeyType
(int key) int
Return the number of keys.getType()
Get the type of this comparator.boolean
isValid()
Validate that this comparator is valid with respect to the type system.void
Set the type of this comparator.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
FEATURE_KEY
static final int FEATURE_KEY- See Also:
-
TYPE_ORDER_KEY
static final int TYPE_ORDER_KEY- See Also:
-
STANDARD_COMPARE
static final int STANDARD_COMPARECompare key1 of fs1 with key2 of fs2 so that the order of fs1 and fs2 is the same as that of key1 and key2 in the standard order for that kind of key. For integer and float values, this is the standard linear order, and for strings it is lexicographic order.- See Also:
-
REVERSE_STANDARD_COMPARE
static final int REVERSE_STANDARD_COMPARECompare key1 of fs1 with key2 of fs2 so that the order of fs1 and fs2 is the reverse as that of key1 and key2 (with respect to the standard order of that key).- See Also:
-
-
Method Details
-
setType
Set the type of this comparator. Note that you can use this method more than once, in case you need to generate indexes that are identical except for the type.- Parameters:
type
- The type of the index.
-
getType
Type getType()Get the type of this comparator.- Returns:
- The type of the comparator.
-
addKey
Add a new key.- Parameters:
feat
- The key feature.compareKey
- The way to compare the key values.- Returns:
- The number of the key.
-
addKey
- Parameters:
typeOrder
- the type ordercompareKey
- the direction- Returns:
- the number of the key
-
getNumberOfKeys
int getNumberOfKeys()Return the number of keys.- Returns:
- the number of keys.
-
getKeyType
int getKeyType(int key) -
getKeyFeature
Get the feature for this key.- Parameters:
key
- The number of the key.- Returns:
- The corresponding feature, if it exists;
null
, else.
-
getKeyComparator
int getKeyComparator(int key) Get the comparator for this key.- Parameters:
key
- The number of the key.- Returns:
- The corresponding comparator, if it exists;
-1
, else.
-
equals
Test for equality against anotherFSIndexComparator
true
iff the comparators have the same keys and comparators. -
isValid
boolean isValid()Validate that this comparator is valid with respect to the type system. Note that all types and features used to define this comparator must come from the same type system. Note that this method only returns true or false. It doesn't tell you what's actually wrong. Maybe we need to change that?- Returns:
true
iff all key features are appropriate for the type of this comparator.
-