Package org.apache.uima.cas.impl
Class LinearTypeOrderBuilderImpl.TotalTypeOrder
- java.lang.Object
-
- org.apache.uima.cas.impl.LinearTypeOrderBuilderImpl.TotalTypeOrder
-
- All Implemented Interfaces:
LinearTypeOrder
- Enclosing class:
- LinearTypeOrderBuilderImpl
public static class LinearTypeOrderBuilderImpl.TotalTypeOrder extends java.lang.Object implements LinearTypeOrder
An implementation of theLinearTypeOrderinterface.
-
-
Field Summary
Fields Modifier and Type Field Description private intcomputedHashCodeprivate booleanhashCodeComputedprivate booleanisEmptyTypeOrderprivate int[]orderprivate short[]typeCodeToOrder
-
Constructor Summary
Constructors Modifier Constructor Description privateTotalTypeOrder(int[] typeList, TypeSystem ts, boolean isEmpty)The constructor for the total type order, called by the other constructor and also when doing a cas complete deserialization, or just deserializing the type system/index defs Create the order from an array of type codes in ascending order.privateTotalTypeOrder(java.lang.String[] typeList, TypeSystem ts, boolean isEmpty)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(FeatureStructure fs1, FeatureStructure fs2)Compare two Feature Structure's typesprivate static int[]encodeTypeList(java.lang.String[] typeList, TypeSystem ts)booleanequals(java.lang.Object obj)int[]getOrder()inthashCode()booleanisEmptyTypeOrder()booleanlessThan(int t1, int t2)Compare two types.booleanlessThan(Type t1, Type t2)Compare two types.
-
-
-
Constructor Detail
-
TotalTypeOrder
private TotalTypeOrder(java.lang.String[] typeList, TypeSystem ts, boolean isEmpty) throws CASException- Throws:
CASException
-
TotalTypeOrder
private TotalTypeOrder(int[] typeList, TypeSystem ts, boolean isEmpty)The constructor for the total type order, called by the other constructor and also when doing a cas complete deserialization, or just deserializing the type system/index defs Create the order from an array of type codes in ascending order.- Parameters:
typeList- the list of ordered typests- the type system
-
-
Method Detail
-
encodeTypeList
private static int[] encodeTypeList(java.lang.String[] typeList, TypeSystem ts) throws CASException- Throws:
CASException
-
compare
public int compare(FeatureStructure fs1, FeatureStructure fs2)
Description copied from interface:LinearTypeOrderCompare two Feature Structure's types- Specified by:
comparein interfaceLinearTypeOrder- Parameters:
fs1- first Feature Structurefs2- second Feature Structure- Returns:
- same as compare functions: -1 if fs1's type < fs2's type, etc.
-
lessThan
public boolean lessThan(Type t1, Type t2)
Description copied from interface:LinearTypeOrderCompare two types.- Specified by:
lessThanin interfaceLinearTypeOrder- Parameters:
t1- type to comparet2- type to compare- Returns:
trueifft1is less thant2in this order.
-
lessThan
public boolean lessThan(int t1, int t2)Description copied from interface:LinearTypeOrderCompare two types.- Specified by:
lessThanin interfaceLinearTypeOrder- Parameters:
t1- type to comparet2- type to compare- Returns:
trueifft1is less thant2in this order.
-
getOrder
public int[] getOrder()
- Specified by:
getOrderin interfaceLinearTypeOrder- Returns:
- The type order as array of type codes in ascending order.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
isEmptyTypeOrder
public boolean isEmptyTypeOrder()
- Specified by:
isEmptyTypeOrderin interfaceLinearTypeOrder- Returns:
- true if there is no type order defined for this pipeline
-
-