Package org.apache.uima.cas.impl
Class FSIndexComparatorImpl
java.lang.Object
org.apache.uima.cas.impl.FSIndexComparatorImpl
- All Implemented Interfaces:
Comparable<FSIndexComparator>
,FSIndexComparator
Specifies the comparison to be used for an index, in terms of
- the keys and the typeorder, in an order
- the standard/reverse ordering
-
Field Summary
Fields inherited from interface org.apache.uima.cas.admin.FSIndexComparator
FEATURE_KEY, REVERSE_STANDARD_COMPARE, STANDARD_COMPARE, TYPE_ORDER_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addKey
(LinearTypeOrder typeOrder, int compareKey) int
Add a new key.int
Compares two FSIndexComparator instances.copy()
boolean
Equals including the type of the comparatorint
getKeyComparator
(int key) Get the comparator for this key.getKeyFeature
(int key) Get the feature for this key.int
getKeyType
(int key) getKeyTypeOrder
(int key) int
Return the number of keys.getType()
Get the type of this comparator.int
hashCode()
boolean
isValid()
Validate that this comparator is valid with respect to the type system.void
Set the type of this comparator.
-
Constructor Details
-
FSIndexComparatorImpl
public FSIndexComparatorImpl()
-
-
Method Details
-
setType
Description copied from interface:FSIndexComparator
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.- Specified by:
setType
in interfaceFSIndexComparator
- Parameters:
type
- The type of the index.
-
getType
Description copied from interface:FSIndexComparator
Get the type of this comparator.- Specified by:
getType
in interfaceFSIndexComparator
- Returns:
- The type of the comparator.
-
addKey
Description copied from interface:FSIndexComparator
Add a new key.- Specified by:
addKey
in interfaceFSIndexComparator
- Parameters:
feat
- The key feature.compareKey
- The way to compare the key values.- Returns:
- The number of the key.
-
addKey
- Specified by:
addKey
in interfaceFSIndexComparator
- Parameters:
typeOrder
- the type ordercompareKey
- the direction- Returns:
- the number of the key
-
getKeyType
public int getKeyType(int key) - Specified by:
getKeyType
in interfaceFSIndexComparator
-
getNumberOfKeys
public int getNumberOfKeys()Description copied from interface:FSIndexComparator
Return the number of keys.- Specified by:
getNumberOfKeys
in interfaceFSIndexComparator
- Returns:
- the number of keys.
-
getKeyFeature
Description copied from interface:FSIndexComparator
Get the feature for this key.- Specified by:
getKeyFeature
in 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:FSIndexComparator
Get the comparator for this key.- Specified by:
getKeyComparator
in interfaceFSIndexComparator
- Parameters:
key
- The number of the key.- Returns:
- The corresponding comparator, if it exists;
-1
, else.
-
equals
Equals including the type of the comparator- Specified by:
equals
in interfaceFSIndexComparator
- Overrides:
equals
in classObject
-
hashCode
public int hashCode() -
isValid
public boolean isValid()Description copied from interface:FSIndexComparator
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?- Specified by:
isValid
in interfaceFSIndexComparator
- Returns:
true
iff all key features are appropriate for the type of this comparator.
-
copy
-
compareTo
Compares two FSIndexComparator instances. The code to compare two FSs is in the compare method of FsIndex_singletype.- Specified by:
compareTo
in interfaceComparable<FSIndexComparator>
- See Also:
-