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 Object
implements LinearTypeOrder
An implementation of the
LinearTypeOrder
interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
private final boolean
private final int[]
private final short[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
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.private
TotalTypeOrder
(String[] typeList, TypeSystem ts, boolean isEmpty) -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(FeatureStructure fs1, FeatureStructure fs2) Compare two Feature Structure's typesprivate static int[]
encodeTypeList
(String[] typeList, TypeSystem ts) boolean
int[]
getOrder()
int
hashCode()
boolean
boolean
lessThan
(int t1, int t2) Compare two types.boolean
Compare two types.
-
Field Details
-
order
private final int[] order -
typeCodeToOrder
private final short[] typeCodeToOrder -
hashCodeComputed
private boolean hashCodeComputed -
computedHashCode
private int computedHashCode -
isEmptyTypeOrder
private final boolean isEmptyTypeOrder
-
-
Constructor Details
-
TotalTypeOrder
- Throws:
CASException
-
TotalTypeOrder
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 Details
-
encodeTypeList
- Throws:
CASException
-
compare
Description copied from interface:LinearTypeOrder
Compare two Feature Structure's types- Specified by:
compare
in interfaceLinearTypeOrder
- Parameters:
fs1
- first Feature Structurefs2
- second Feature Structure- Returns:
- same as compare functions: -1 if fs1's type < fs2's type, etc.
-
lessThan
Description copied from interface:LinearTypeOrder
Compare two types.- Specified by:
lessThan
in interfaceLinearTypeOrder
- Parameters:
t1
- type to comparet2
- type to compare- Returns:
true
ifft1
is less thant2
in this order.
-
lessThan
public boolean lessThan(int t1, int t2) Description copied from interface:LinearTypeOrder
Compare two types.- Specified by:
lessThan
in interfaceLinearTypeOrder
- Parameters:
t1
- type to comparet2
- type to compare- Returns:
true
ifft1
is less thant2
in this order.
-
getOrder
public int[] getOrder()- Specified by:
getOrder
in interfaceLinearTypeOrder
- Returns:
- The type order as array of type codes in ascending order.
-
hashCode
public int hashCode() -
equals
-
isEmptyTypeOrder
public boolean isEmptyTypeOrder()- Specified by:
isEmptyTypeOrder
in interfaceLinearTypeOrder
- Returns:
- true if there is no type order defined for this pipeline
-