Package org.apache.uima.cas.impl
Class CASMgrSerializer
- java.lang.Object
-
- org.apache.uima.cas.impl.CASMgrSerializer
-
- All Implemented Interfaces:
java.io.Serializable
public class CASMgrSerializer extends java.lang.Object implements java.io.Serializable
Container for serialized CAS typing information. Contains information about the type system, as well as the index repository. If more than one CAS that use the same type system and index repository need to be serialized, this information needs to be serialized only once.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int[]
comparatorIndex
For each index, where the corresponding comparator starts in thecomparators
field.int[]
comparators
Encodings of the actual comparators.int[]
featDecls
Feature declarations.java.lang.String[]
featureNames
A list of feature names (symbol table).int[]
featureOffsets
The offsets for features.int[]
indexingStrategy
For each index, the indexing strategy of that index.java.lang.String[]
indexNames
The index identifiers.int[]
nameToIndexMap
A mapping from index names to index IDs.(package private) static long
serialVersionUID
int
source
Set this appropriately.static int
SOURCE_JEDI
static int
SOURCE_TAF
int[]
stringSubtypes
A list of type codes for the string subtypes.int[]
stringSubtypeValuePos
The start positions of the string value subarrays ofstringSubtypeValues
.java.lang.String[]
stringSubtypeValues
The string values for the string subtypes.int
topTypeCode
The internal code of the top type.int[]
typeInheritance
Type inheritance information: for each type other than the top type, we provide the parent in the inheritance scheme.java.lang.String[]
typeNames
A list of type names (symbol table).int[]
typeOrder
-
Constructor Summary
Constructors Constructor Description CASMgrSerializer()
Constructor for CASMgrSerializer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIndexRepository(FSIndexRepositoryImpl ir)
Serialize index repository.void
addTypeSystem(TypeSystemImpl ts)
private void
encodeFeatureDecls(TypeSystemImpl ts)
private void
encodeStringSubtypes(TypeSystemImpl ts)
private void
encodeTypeInheritance(TypeSystemImpl ts)
FSIndexRepositoryImpl
getIndexRepository(CASImpl cas)
Deserialize the index specification and type ordering information in this class instance into the index repository and cas and type system.private java.lang.String[]
getStringArray(int pos)
private java.util.Vector<Type>
getStringSubtypes(TypeSystemImpl ts)
private java.lang.String[]
getSubarray(java.lang.String[] array, int from, int to)
TypeSystemImpl
getTypeSystem()
boolean
hasIndexRepository()
private int
isStringSubtype(int type)
(package private) static java.lang.String[]
symbolTable2StringArray(SymbolTable st)
-
-
-
Field Detail
-
SOURCE_JEDI
public static final int SOURCE_JEDI
- See Also:
- Constant Field Values
-
SOURCE_TAF
public static final int SOURCE_TAF
- See Also:
- Constant Field Values
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
typeOrder
public int[] typeOrder
-
indexNames
public java.lang.String[] indexNames
The index identifiers. Note that more than one identifier can refer to the same index.
-
nameToIndexMap
public int[] nameToIndexMap
A mapping from index names to index IDs. We have thatindexNames.length == nameToIndexMap.length
and for eachi
innameToIndexMap
,0 <= i < indexTypes.length
.
-
indexingStrategy
public int[] indexingStrategy
For each index, the indexing strategy of that index. Current options areSORTED_INDEX
,SET_INDEX
andBAG_INDEX
.indexingStrategy.length == indexTypes.length
.
-
comparatorIndex
public int[] comparatorIndex
For each index, where the corresponding comparator starts in thecomparators
field.comparatorIndex.length == indexTypes.length
.
-
comparators
public int[] comparators
Encodings of the actual comparators. Each comparator occupies an odd number of cells: one for the type, then feature/comparison pairs. The feature is encoded with its type system code, and comparison operations are encoded withSTANDARD_COMPARE
andREVERSE_STANDARD_COMPARE
.
-
typeNames
public java.lang.String[] typeNames
A list of type names (symbol table). fs-typed arrays have names XXXX[]. Note: numbering of types starts at1
, and we index the names according to their internal code. That means thattypeNames[0] == null
.
-
featureNames
public java.lang.String[] featureNames
A list of feature names (symbol table). Note: numbering of features starts at1
, , and we index the names according to their internal code. That means thatfeatureNames[0] == null
.
-
typeInheritance
public int[] typeInheritance
Type inheritance information: for each type other than the top type, we provide the parent in the inheritance scheme. We use the internal type codes for indexing, which means that cells 0 (no type) and 1 (top type doesn't inherit from anything) are not used.
-
featDecls
public int[] featDecls
Feature declarations. For each feature codei
(which is an integer ≥ 1),featDecls[(i-1)*3]
is the domain type code,featDecls[(i-1)*3+1]
is the range type code, andfeatDecls[(i-1)*3+2]
is the multipleReferencesAllowed flag (0 or 1).
-
topTypeCode
public int topTypeCode
The internal code of the top type. Optional, used for sanity checks.
-
featureOffsets
public int[] featureOffsets
The offsets for features. Optional, used for sanity checks. Since feature numbering starts at 1, the length of the array is 1 + number of features.
-
stringSubtypes
public int[] stringSubtypes
A list of type codes for the string subtypes.
-
stringSubtypeValues
public java.lang.String[] stringSubtypeValues
The string values for the string subtypes. Start and end postions for the values for the individual types are instringSubtypeValuePos
.
-
stringSubtypeValuePos
public int[] stringSubtypeValuePos
The start positions of the string value subarrays ofstringSubtypeValues
.stringSubtypeValuePos.length == stringSubtypes.length
. For eachi < stringSubtypes.length
,stringSubtypeValuePos[i]
is the start of the string values forstringSubtypes[i]
.
-
source
public int source
Set this appropriately.
-
-
Method Detail
-
addIndexRepository
public void addIndexRepository(FSIndexRepositoryImpl ir)
Serialize index repository.- Parameters:
ir
- The index repository to be serialized.
-
addTypeSystem
public void addTypeSystem(TypeSystemImpl ts)
-
encodeStringSubtypes
private void encodeStringSubtypes(TypeSystemImpl ts)
-
getStringSubtypes
private java.util.Vector<Type> getStringSubtypes(TypeSystemImpl ts)
-
symbolTable2StringArray
static java.lang.String[] symbolTable2StringArray(SymbolTable st)
-
encodeFeatureDecls
private void encodeFeatureDecls(TypeSystemImpl ts)
-
encodeTypeInheritance
private void encodeTypeInheritance(TypeSystemImpl ts)
-
isStringSubtype
private int isStringSubtype(int type)
-
getSubarray
private java.lang.String[] getSubarray(java.lang.String[] array, int from, int to)
-
getStringArray
private java.lang.String[] getStringArray(int pos)
-
getTypeSystem
public TypeSystemImpl getTypeSystem()
-
getIndexRepository
public FSIndexRepositoryImpl getIndexRepository(CASImpl cas)
Deserialize the index specification and type ordering information in this class instance into the index repository and cas and type system.- Parameters:
cas
- -- Returns:
- -
-
hasIndexRepository
public boolean hasIndexRepository()
-
-