Package org.apache.uima.cas.impl
Class FSIndexComparatorImpl
java.lang.Object
org.apache.uima.cas.impl.FSIndexComparatorImpl
- All Implemented Interfaces:
Comparable<FSIndexComparator>,FSIndexComparator
-
Field Summary
Fields inherited from interface org.apache.uima.cas.admin.FSIndexComparator
FEATURE_KEY, REVERSE_STANDARD_COMPARE, STANDARD_COMPARE, TYPE_ORDER_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddKey(LinearTypeOrder typeOrder, int compareKey) intAdd a new key.intCompares two FSIndexComparator instances.booleanTest for equality against anotherFSIndexComparatortrueiff the comparators have the same keys and comparators.intgetKeyComparator(int key) Get the comparator for this key.getKeyFeature(int key) Get the feature for this key.intgetKeyType(int key) getKeyTypeOrder(int key) intReturn the number of keys.getType()Get the type of this comparator.inthashCode()booleanisValid()Validate that this comparator is valid with respect to the type system.voidSet the type of this comparator.
-
Constructor Details
-
FSIndexComparatorImpl
-
-
Method Details
-
setType
Description copied from interface:FSIndexComparatorSet 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.- Specified by:
setTypein interfaceFSIndexComparator- Parameters:
type- The type of the index.
-
getType
Description copied from interface:FSIndexComparatorGet the type of this comparator.- Specified by:
getTypein interfaceFSIndexComparator- Returns:
- The type of the comparator.
-
addKey
Description copied from interface:FSIndexComparatorAdd a new key.- Specified by:
addKeyin interfaceFSIndexComparator- Parameters:
feat- The key feature.compareKey- The way to compare the key values.- Returns:
- The number of the key.
-
addKey
- Specified by:
addKeyin interfaceFSIndexComparator
-
getKeyType
public int getKeyType(int key) - Specified by:
getKeyTypein interfaceFSIndexComparator
-
getNumberOfKeys
public int getNumberOfKeys()Description copied from interface:FSIndexComparatorReturn the number of keys.- Specified by:
getNumberOfKeysin interfaceFSIndexComparator- Returns:
- the number of keys.
-
getKeyFeature
Description copied from interface:FSIndexComparatorGet the feature for this key.- Specified by:
getKeyFeaturein interfaceFSIndexComparator- Parameters:
key- The number of the key.- Returns:
- The corresponding feature, if it exists;
null, else.
-
getKeyTypeOrder
-
getKeyComparator
public int getKeyComparator(int key) Description copied from interface:FSIndexComparatorGet the comparator for this key.- Specified by:
getKeyComparatorin interfaceFSIndexComparator- Parameters:
key- The number of the key.- Returns:
- The corresponding comparator, if it exists;
-1, else.
-
equals
Description copied from interface:FSIndexComparatorTest for equality against anotherFSIndexComparatortrueiff the comparators have the same keys and comparators.- Specified by:
equalsin interfaceFSIndexComparator- Overrides:
equalsin classObject
-
hashCode
public int hashCode() -
isValid
public boolean isValid()Description copied from interface:FSIndexComparatorValidate 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?- Specified by:
isValidin interfaceFSIndexComparator- Returns:
trueiff all key features are appropriate for the type of this comparator.
-
compareTo
Compares two FSIndexComparator instances. The code to compare two FSs is in the compare method of FSLeafIndexImpl.- Specified by:
compareToin interfaceComparable<FSIndexComparator>- See Also:
-