Package org.apache.uima.cas.impl
Class TypeSystemImpl
java.lang.Object
org.apache.uima.cas.impl.TypeSystemImpl
- All Implemented Interfaces:
TypeSystemMgr
,LowLevelTypeSystem
,TypeSystem
Type system implementation.
Threading: An instance of this object should be thread safe after creation, because multiple threads
are reading info from it.
During creation, only one thread is creating.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
(package private) class
Each instance holds info needed in binary serialization of data for a particular type -
Field Summary
FieldsModifier and TypeFieldDescription(package private) TypeImpl
(package private) static final int
static final int
(package private) TypeImpl
(package private) static final int
For each type, an IntVector of appropriate feature codes(package private) boolean
(package private) TypeImpl
(package private) static final int
private final RedBlackTree
<TypeImpl> private final IntRedBlackTree
private static final String
(package private) TypeImpl
static final int
(package private) static final int
(package private) TypeImpl
static final int
(package private) static final int
(package private) final CASMetadata
private final IntRedBlackTree
(package private) TypeImpl
(package private) TypeImpl
static final int
(package private) static final int
(package private) FeatureImpl
static final int
private final IntVector
private final StringToIntMap
private final SymbolTable
(package private) TypeImpl
static final int
(package private) static final int
(package private) TypeImpl
static final int
private static final int[]
(package private) TypeImpl
static final int
private final IntVector
(package private) static final int
(package private) FeatureImpl
(package private) static final int
private static final int
private static final int
private boolean
(package private) TypeImpl
static final int
(package private) static final int
private int
private int
private int
private final IntVector
array of parent typeCodes indexed by typeCode(package private) TypeImpl
static final int
(package private) static final int
(package private) static final int
static final int
(package private) static final int
(package private) FeatureImpl
static final int
static final int
(package private) static final int
(package private) static final int
(package private) FeatureImpl
static final int
(package private) TypeImpl
static final int
private final IntRedBlackTree
(package private) static final int
List indexed by supertype code, Value is bits set of subtypes of that code, including the type itselfprivate static final int
List indexed by supertype code Value is an IntVector representing type codes for directly subsumed types (just one level below)(package private) TypeSystemImpl.TypeInfo[]
private final SymbolTable
An ArrayList, unsynchronized, indexed by typeCode, of Type objectsfinal Map
<TypeSystemImpl, CasTypeSystemMapper> Type Mapping Objects used in compressed binary (de)serialization These are in an identity map, key = target type system Threading: this map is used by multiple threads Key = target type system, via a weak reference.private static final IntVector
Fields inherited from interface org.apache.uima.cas.impl.LowLevelTypeSystem
UNKNOWN_FEATURE_CODE, UNKNOWN_TYPE_CODE
Fields inherited from interface org.apache.uima.cas.TypeSystem
FEATURE_SEPARATOR, NAMESPACE_SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
addArrayType
(Type componentType, Type mother) (package private) int
addFeature
(String shortName, int domain, int range) (package private) int
addFeature
(String shortName, int domain, int range, boolean multiRefsAllowed) Add a new feature to the type system.addFeature
(String featureName, Type domainType, Type rangeType) Add an feature to the type system.addFeature
(String featureName, Type domainType, Type rangeType, boolean multipleReferencesAllowed) Add an feature to the type system.addStringSubtype
(String typeName, String[] stringList) Inherit from String.private void
addSubsubsumption
(int superType, int type) addTopType
(String name) Add a top type to the (empty) type system.private int
addTopTypeInternal
(String name) (package private) int
(package private) int
Internal code for adding a new type.Add a new type to the type system.private void
checkFeatureNameSyntax
(String name) Method checkFeatureNameSyntax.private void
checkTypeSyntax
(String name) Method checkTypeSyntax.void
commit()
Commit the type system.boolean
directlySubsumes
(int t1, int t2) (package private) static final String
getArrayComponentName
(String arrayTypeName) getArrayType
(Type componentType) Obtain an array type with component typecomponentType
.private static final String
getArrayTypeName
(String typeName) private static final String
getBuiltinArrayComponent
(String typeName) getDirectlySubsumedTypes
(Type type) Get a vector of the types directly subsumed by a given type.getDirectSubtypes
(Type type) Get a List of the types directly subsumed by a given type.getFeature
(String featureName) Deprecated.getFeatureByFullName
(String featureName) Get an feature object for a given name.(package private) int
getFeatureOffset
(int feat) Get a list of features, in no particular order.private final String
getIntroFeatures
(Type type) private final int
final int
Return the low-level view of this type system.int
Get the overall number of features defined in the type system.int
Get the overall number of types defined in the type system.Get the parent type for input type.getProperlySubsumedTypes
(Type type) Return the list of all types subsumed by the input type.(package private) final int
(package private) final int
String[]
getStringSet
(int i) Get the top type, i.e., the root of the type system.Get a type object for a given name.(package private) final int
(package private) TypeSystemImpl.TypeInfo
getTypeInfo
(int typeCode) Get an iterator over all types, in no particular order.getTypeNameSpace
(String name) Create a type name space object for the name parameter.(package private) SymbolTable
private final String
(package private) CasTypeSystemMapper
private final void
(package private) final void
int
intro
(int feat) boolean
isAnnotationBaseOrSubtype
(int typeCode) boolean
isAnnotationOrSubtype
(int typeCode) boolean
isApprop
(int type, int feat) Check if feature is appropriate for type (i.e., type is subsumed by domain type of feature).(package private) static boolean
isArrayTypeNameButNotBuiltIn
(String typeName) boolean
Check if this instance has been committed.(package private) final boolean
isFeature
(int featureCode) boolean
isType
(int type) (package private) int
ll_addArrayType
(int componentTypeCode, int motherCode) (package private) int
ll_computeArrayParentFromComponentType
(int componentType) int[]
ll_getAppropriateFeatures
(int type) Get an array of the appropriate features for this type.int
ll_getArrayType
(int componentTypeCode) Get the type code for the array type withcomponentTypeCode
as component type code.int
ll_getCodeForFeature
(Feature feature) Get the code for a given feature object.int
ll_getCodeForFeatureName
(String featureName) Get the feature code for a given feature name.int
ll_getCodeForType
(Type type) Get the code of an existing type object.int
ll_getCodeForTypeName
(String typeName) Get the type code for a given type name.int
ll_getComponentType
(int arrayTypeCode) Get the component type of an array type code.int
ll_getDomainType
(int featureCode) Get the domain type for a given feature.ll_getFeatureForCode
(int featureCode) Get a feature object for a given code.int
ll_getParentType
(int typeCode) Get the parent type for the input type.int
ll_getRangeType
(int featureCode) Get the range type for a given feature.String[]
ll_getStringSet
(int typeCode) Get the string set (sorted) for a string subtype.final int
ll_getTypeClass
(int typeCode) Determine the type class of a type.ll_getTypeForCode
(int typeCode) Get a type object for a given code.boolean
ll_isArrayType
(int typeCode) Check iftypeCode
is the type code of an array type.private boolean
ll_isPrimitiveArrayType
(int type) boolean
ll_isPrimitiveType
(int typeCode) Check iftypeCode
is the type code of a primitive type.boolean
ll_isRefType
(int typeCode) Checks if the type code is that of a reference type (anything that's not a basic type, currently Integer, String, Float, Boolean, Byte, Short, Long, Double, and subtypes of String - specifying allowed-values).boolean
ll_isStringSubtype
(int type) Check if type is a string subtype.boolean
ll_isValidTypeCode
(int typeCode) Check the input type code.boolean
ll_subsumes
(int superType, int type) Check subsumption between two types.private void
newType()
int
range
(int feat) Get the range type for a feature.void
setFeatureFinal
(Type type) Make type feature final in the sense that no new features can be added to this type.void
setInheritanceFinal
(Type type) Block any further inheritance from this type.boolean
subsumes
(int superType, int type) Check if the first argument subsumes the secondboolean
Does one type inherit from the other?toString()
This writes out the type hierarchy in a human-readable form.int
unify
(int t1, int t2) private void
updateSubsumption
(int type, int superType)
-
Field Details
-
INT0
private static final int[] INT0 -
zeroLengthIntVector
-
LEAST_TYPE_CODE
private static final int LEAST_TYPE_CODE- See Also:
-
LEAST_FEATURE_CODE
private static final int LEAST_FEATURE_CODE- See Also:
-
arrayComponentTypeNameMap
-
arrayTypeComponentNameMap
-
arrayTypeSuffix
- See Also:
-
typeNameST
-
featureNameST
-
featureMap
-
tree
List indexed by supertype code Value is an IntVector representing type codes for directly subsumed types (just one level below) -
subsumes
List indexed by supertype code, Value is bits set of subtypes of that code, including the type itself -
intro
-
featRange
-
approp
For each type, an IntVector of appropriate feature codes -
top
private static final int top- See Also:
-
types
An ArrayList, unsynchronized, indexed by typeCode, of Type objects -
features
-
parents
array of parent typeCodes indexed by typeCode -
stringSets
-
stringSetMap
-
componentToArrayTypeMap
-
arrayToComponentTypeMap
-
arrayCodeToTypeMap
-
locked
private boolean locked -
numCommittedTypes
private int numCommittedTypes -
numTypeNames
private int numTypeNames -
numFeatureNames
private int numFeatureNames -
casMetadata
-
typeInfoArray
TypeSystemImpl.TypeInfo[] typeInfoArray -
areBuiltInTypesSetup
volatile boolean areBuiltInTypesSetup -
intType
-
stringType
-
floatType
-
arrayBaseType
TypeImpl arrayBaseType -
intArrayType
TypeImpl intArrayType -
floatArrayType
TypeImpl floatArrayType -
stringArrayType
TypeImpl stringArrayType -
fsArrayType
TypeImpl fsArrayType -
sofaType
-
annotType
TypeImpl annotType -
annotBaseType
TypeImpl annotBaseType -
docType
TypeImpl docType -
startFeat
FeatureImpl startFeat -
endFeat
FeatureImpl endFeat -
langFeat
FeatureImpl langFeat -
sofaNum
FeatureImpl sofaNum -
byteType
-
byteArrayType
TypeImpl byteArrayType -
booleanType
-
booleanArrayType
TypeImpl booleanArrayType -
shortType
-
shortArrayType
TypeImpl shortArrayType -
longType
-
longArrayType
TypeImpl longArrayType -
doubleType
-
doubleArrayType
TypeImpl doubleArrayType -
intTypeCode
static final int intTypeCode- See Also:
-
stringTypeCode
static final int stringTypeCode- See Also:
-
floatTypeCode
static final int floatTypeCode- See Also:
-
arrayBaseTypeCode
static final int arrayBaseTypeCode- See Also:
-
intArrayTypeCode
public static final int intArrayTypeCode- See Also:
-
floatArrayTypeCode
public static final int floatArrayTypeCode- See Also:
-
stringArrayTypeCode
public static final int stringArrayTypeCode- See Also:
-
fsArrayTypeCode
public static final int fsArrayTypeCode- See Also:
-
sofaTypeCode
static final int sofaTypeCode- See Also:
-
annotTypeCode
static final int annotTypeCode- See Also:
-
annotBaseTypeCode
static final int annotBaseTypeCode- See Also:
-
byteTypeCode
static final int byteTypeCode- See Also:
-
booleanTypeCode
static final int booleanTypeCode- See Also:
-
shortTypeCode
static final int shortTypeCode- See Also:
-
longTypeCode
static final int longTypeCode- See Also:
-
doubleTypeCode
static final int doubleTypeCode- See Also:
-
byteArrayTypeCode
public static final int byteArrayTypeCode- See Also:
-
booleanArrayTypeCode
public static final int booleanArrayTypeCode- See Also:
-
shortArrayTypeCode
public static final int shortArrayTypeCode- See Also:
-
longArrayTypeCode
public static final int longArrayTypeCode- See Also:
-
doubleArrayTypeCode
public static final int doubleArrayTypeCode- See Also:
-
sofaNumFeatCode
public static final int sofaNumFeatCode- See Also:
-
sofaIdFeatCode
public static final int sofaIdFeatCode- See Also:
-
sofaStringFeatCode
public static final int sofaStringFeatCode- See Also:
-
sofaMimeFeatCode
static final int sofaMimeFeatCode- See Also:
-
sofaUriFeatCode
static final int sofaUriFeatCode- See Also:
-
sofaArrayFeatCode
static final int sofaArrayFeatCode- See Also:
-
annotSofaFeatCode
public static final int annotSofaFeatCode- See Also:
-
startFeatCode
public static final int startFeatCode- See Also:
-
endFeatCode
public static final int endFeatCode- See Also:
-
langFeatCode
static final int langFeatCode- See Also:
-
typeSystemMappers
Type Mapping Objects used in compressed binary (de)serialization These are in an identity map, key = target type system Threading: this map is used by multiple threads Key = target type system, via a weak reference. Automatically cleared via WeakHashMap The may itself is not synchronized, because all accesses to it are from the synchronized getTypeSystemMapper method
-
-
Constructor Details
-
TypeSystemImpl
Deprecated.Use 0 arg constructor. Type Systems are shared by many CASes, and can't point to one. Change also your possible calls to ts.commit() - see comment on that method.Default constructor.- Parameters:
cas
- -
-
TypeSystemImpl
public TypeSystemImpl()
-
-
Method Details
-
initTypeVariables
final void initTypeVariables() -
initTypeCodeVars
private final void initTypeCodeVars() -
getSmallestType
final int getSmallestType() -
getSmallestFeature
final int getSmallestFeature() -
getTypeArraySize
final int getTypeArraySize() -
getIntroFeatures
-
getParent
Description copied from interface:TypeSystem
Get the parent type for input type.- Specified by:
getParent
in interfaceTypeSystem
- Parameters:
t
- The type we want to know the parent of.- Returns:
- The parent type, or
null
for the top type.
-
ll_getParentType
public int ll_getParentType(int typeCode) Description copied from interface:LowLevelTypeSystem
Get the parent type for the input type.- Specified by:
ll_getParentType
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The type code we want the parent for.- Returns:
- The type code of the parent type.
-
ll_computeArrayParentFromComponentType
int ll_computeArrayParentFromComponentType(int componentType) -
isApprop
public boolean isApprop(int type, int feat) Check if feature is appropriate for type (i.e., type is subsumed by domain type of feature).- Parameters:
type
- -feat
- -- Returns:
- true if feature is appropriate for type (i.e., type is subsumed by domain type of feature).
-
getLargestTypeCode
public final int getLargestTypeCode() -
isType
public boolean isType(int type) -
getType
Get a type object for a given name.- Specified by:
getType
in interfaceTypeSystem
- Parameters:
typeName
- The name of the type.- Returns:
- A type object, or
null
if no such type exists.
-
getFeatureByFullName
Get an feature object for a given name.- Specified by:
getFeatureByFullName
in interfaceTypeSystem
- Parameters:
featureName
- The name of the feature.- Returns:
- An feature object, or
null
if no such feature exists.
-
getArrayTypeName
-
getArrayComponentName
-
isArrayTypeNameButNotBuiltIn
-
getBuiltinArrayComponent
-
addType
Add a new type to the type system.- Specified by:
addType
in interfaceTypeSystemMgr
- Parameters:
typeName
- The name of the new type.mother
- The type node under which the new type should be attached.- Returns:
- The new type, or
null
iftypeName
is already in use. - Throws:
CASAdminException
- IftypeName
is not a legal type name, type system is locked, ormother
is inheritance final.
-
checkTypeSyntax
Method checkTypeSyntax.- Parameters:
typeName
-- Throws:
CASAdminException
-
addType
-
addType
Internal code for adding a new type. Warning: no syntax check on type name, must be done by caller. This method is not private because it's used by the serialization code. -
addFeature
public Feature addFeature(String featureName, Type domainType, Type rangeType) throws CASAdminException Description copied from interface:TypeSystemMgr
Add an feature to the type system.- Specified by:
addFeature
in interfaceTypeSystemMgr
- Parameters:
featureName
- The name of the new feature.domainType
- The type that defines the domain of the feature.rangeType
- The type that defines the range of the feature.- Returns:
- The new feature object, or
null
iffeatureName
is already in use fordomainType
with the same range (if the range is different, an exception is thrown). - Throws:
CASAdminException
- IffeatureName
is not a legal feature name, the type system is locked ordomainType
is feature final. Also iffeatureName
has already been defined ondomainType
(or a supertype) with a different range thanrangeType
.
-
addFeature
public Feature addFeature(String featureName, Type domainType, Type rangeType, boolean multipleReferencesAllowed) throws CASAdminException Description copied from interface:TypeSystemMgr
Add an feature to the type system.- Specified by:
addFeature
in interfaceTypeSystemMgr
- Parameters:
featureName
- The name of the new feature.domainType
- The type that defines the domain of the feature.rangeType
- The type that defines the range of the feature.multipleReferencesAllowed
- If therangeType
is an array type, you can use this flag to enforce that the feature value is not referenced anywhere else. This is currently only used for XMI serialization. Defaults totrue
.- Returns:
- The new feature object, or
null
iffeatureName
is already in use fordomainType
with the same range (if the range is different, an exception is thrown). - Throws:
CASAdminException
- IffeatureName
is not a legal feature name, the type system is locked ordomainType
is feature final. Also iffeatureName
has already been defined ondomainType
(or a supertype) with a different range thanrangeType
.- See Also:
-
checkFeatureNameSyntax
Method checkFeatureNameSyntax.- Throws:
CASAdminException
-
getTypeIterator
Get an iterator over all types, in no particular order.- Specified by:
getTypeIterator
in interfaceTypeSystem
- Returns:
- The iterator.
-
getFeatures
Description copied from interface:TypeSystem
Get a list of features, in no particular order.- Specified by:
getFeatures
in interfaceTypeSystem
- Returns:
- An iterator over the features.
-
getTopType
Get the top type, i.e., the root of the type system.- Specified by:
getTopType
in interfaceTypeSystem
- Returns:
- The top type.
-
getProperlySubsumedTypes
Return the list of all types subsumed by the input type. Note: the list does not include the type itself.- Specified by:
getProperlySubsumedTypes
in interfaceTypeSystem
- Parameters:
type
- Input type.- Returns:
- The list of types subsumed by
type
.
-
getDirectlySubsumedTypes
Get a vector of the types directly subsumed by a given type.- Specified by:
getDirectlySubsumedTypes
in interfaceTypeSystem
- Parameters:
type
- The input type.- Returns:
- A vector of the directly subsumed types.
-
getDirectSubtypes
Description copied from interface:TypeSystem
Get a List of the types directly subsumed by a given type.- Specified by:
getDirectSubtypes
in interfaceTypeSystem
- Parameters:
type
- The input type.- Returns:
- A List of the directly subsumed types.
-
getDirectSubtypesIterator
- Parameters:
type
- whose direct instantiable subtypes to iterate over- Returns:
- an iterator over the direct instantiable subtypes
-
directlySubsumes
public boolean directlySubsumes(int t1, int t2) -
subsumes
Does one type inherit from the other?- Specified by:
subsumes
in interfaceTypeSystem
- Parameters:
superType
- Supertype.subType
- Subtype.- Returns:
true
iffsub
inherits fromsuper
.
-
ll_getAppropriateFeatures
public int[] ll_getAppropriateFeatures(int type) Get an array of the appropriate features for this type.- Specified by:
ll_getAppropriateFeatures
in interfaceLowLevelTypeSystem
- Parameters:
type
- Input type code.- Returns:
- The array of appropriate features for
typeCode
.
-
getFeatureOffset
int getFeatureOffset(int feat) - Returns:
- An offset
>0
iffeat
exists;0
, else.
-
getNumberOfFeatures
public int getNumberOfFeatures()Get the overall number of features defined in the type system.- Returns:
- -
-
getNumberOfTypes
public int getNumberOfTypes()Get the overall number of types defined in the type system.- Returns:
- -
-
intro
public int intro(int feat) - Parameters:
feat
- -- Returns:
- the domain type for a feature.
-
range
public int range(int feat) Get the range type for a feature.- Parameters:
feat
- -- Returns:
- -
-
unify
public int unify(int t1, int t2) -
addFeature
-
addFeature
Add a new feature to the type system.- Parameters:
shortName
- -domain
- -range
- -multiRefsAllowed
- -- Returns:
- -
-
addTopType
Add a top type to the (empty) type system.- Parameters:
name
- -- Returns:
- -
-
addTopTypeInternal
-
subsumes
public boolean subsumes(int superType, int type) Check if the first argument subsumes the second- Parameters:
superType
- -type
- -- Returns:
- true if first argument subsumes the second
-
ll_isPrimitiveArrayType
private boolean ll_isPrimitiveArrayType(int type) -
ll_subsumes
public boolean ll_subsumes(int superType, int type) Description copied from interface:LowLevelTypeSystem
Check subsumption between two types.- Specified by:
ll_subsumes
in interfaceLowLevelTypeSystem
- Parameters:
superType
- -type
- -- Returns:
true
ifftype1
subsumestype2
.
-
updateSubsumption
private void updateSubsumption(int type, int superType) -
addSubsubsumption
private void addSubsubsumption(int superType, int type) -
newType
private void newType() -
getTypeNameST
SymbolTable getTypeNameST() -
getTypeString
-
getFeatureString
-
toString
This writes out the type hierarchy in a human-readable form. -
commit
public void commit()Description copied from interface:TypeSystemMgr
Commit the type system. The type system will be locked and no longer writable. WARNING: Users should not call this, but instead call ((CASImpl) theAssociatedCAS).commitTypeSystem() in order to set up the parts of the CAS that should be set up when the type system is committed.- Specified by:
commit
in interfaceTypeSystemMgr
- See Also:
-
isCommitted
public boolean isCommitted()Description copied from interface:TypeSystemMgr
Check if this instance has been committed.- Specified by:
isCommitted
in interfaceTypeSystemMgr
- Returns:
true
iff this instance has been committed.- See Also:
-
isAnnotationBaseOrSubtype
public boolean isAnnotationBaseOrSubtype(int typeCode) - Parameters:
typeCode
- for a type- Returns:
- true if type is AnnotationBase or a subtype of it
-
isAnnotationOrSubtype
public boolean isAnnotationOrSubtype(int typeCode) - Parameters:
typeCode
- for a type- Returns:
- true if type is Annotation or a subtype of it
-
getFeature
Deprecated. -
setFeatureFinal
Description copied from interface:TypeSystemMgr
Make type feature final in the sense that no new features can be added to this type. Note that making a type feature final automatically makes all ancestors of that type feature final as well.- Specified by:
setFeatureFinal
in interfaceTypeSystemMgr
- Parameters:
type
- The type to be made feature final.- See Also:
-
setInheritanceFinal
Description copied from interface:TypeSystemMgr
Block any further inheritance from this type. Does not mean that the type can have no sub-types, just that no new ones can be introduced.- Specified by:
setInheritanceFinal
in interfaceTypeSystemMgr
- Parameters:
type
- the type to block subtypes on- See Also:
-
addStringSubtype
Description copied from interface:TypeSystemMgr
Inherit from String. The only way you can inherit from String is by providing a restriction to a set of strings that are possible values for features of this type. This restriction will be checked when such feature values are set. Note that you can not introduce any features on such types, nor can you subtype them any further.- Specified by:
addStringSubtype
in interfaceTypeSystemMgr
- Parameters:
typeName
- The name of the type to be created.stringList
- The list of legal string values for this string type.- Returns:
- The resulting type, or
null
if the type is already defined. - Throws:
CASAdminException
- If the type system is locked.- See Also:
-
getStringSet
-
getTypeNameSpace
Description copied from interface:TypeSystem
Create a type name space object for the name parameter.- Specified by:
getTypeNameSpace
in interfaceTypeSystem
- Parameters:
name
- The name of the name space.- Returns:
- A
TypeNameSpace
object corresponding toname
, ornull
, ifname
is not a legal type name space identifier.
-
ll_getCodeForTypeName
Description copied from interface:LowLevelTypeSystem
Get the type code for a given type name.- Specified by:
ll_getCodeForTypeName
in interfaceLowLevelTypeSystem
- Parameters:
typeName
- The name of the type.- Returns:
- The code for the type. A return value of
0
means that the a type of that name does not exist in the type system.
-
ll_getCodeForType
Description copied from interface:LowLevelTypeSystem
Get the code of an existing type object.- Specified by:
ll_getCodeForType
in interfaceLowLevelTypeSystem
- Parameters:
type
- A type object.- Returns:
- The type code for the input type.
-
ll_getCodeForFeatureName
Description copied from interface:LowLevelTypeSystem
Get the feature code for a given feature name.- Specified by:
ll_getCodeForFeatureName
in interfaceLowLevelTypeSystem
- Parameters:
featureName
- The name of the feature.- Returns:
- The code for the feature. A return value of
0
means that the name does not represent a feature in the type system.
-
ll_getCodeForFeature
Description copied from interface:LowLevelTypeSystem
Get the code for a given feature object.- Specified by:
ll_getCodeForFeature
in interfaceLowLevelTypeSystem
- Parameters:
feature
- A feature object.- Returns:
- The code for the feature.
-
ll_getTypeForCode
Description copied from interface:LowLevelTypeSystem
Get a type object for a given code.- Specified by:
ll_getTypeForCode
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The code of the type.- Returns:
- A type object, or
null
iftypeCode
is not a valid type code.
-
getLargestFeatureCode
private final int getLargestFeatureCode() -
isFeature
final boolean isFeature(int featureCode) -
ll_getFeatureForCode
Description copied from interface:LowLevelTypeSystem
Get a feature object for a given code.- Specified by:
ll_getFeatureForCode
in interfaceLowLevelTypeSystem
- Parameters:
featureCode
- The code of the feature.- Returns:
- A feature object, or
null
iffeatureCode
is not a valid feature code.
-
ll_getDomainType
public int ll_getDomainType(int featureCode) Description copied from interface:LowLevelTypeSystem
Get the domain type for a given feature.- Specified by:
ll_getDomainType
in interfaceLowLevelTypeSystem
- Parameters:
featureCode
- Input feature code.- Returns:
- The domain type code for
featureCode
.
-
ll_getRangeType
public int ll_getRangeType(int featureCode) Description copied from interface:LowLevelTypeSystem
Get the range type for a given feature.- Specified by:
ll_getRangeType
in interfaceLowLevelTypeSystem
- Parameters:
featureCode
- Input feature code.- Returns:
- The range type code for
featureCode
.
-
getLowLevelTypeSystem
Description copied from interface:TypeSystem
Return the low-level view of this type system.- Specified by:
getLowLevelTypeSystem
in interfaceTypeSystem
- Returns:
- The
LowLevelTypeSystem
version of this type system.
-
ll_isStringSubtype
public boolean ll_isStringSubtype(int type) Description copied from interface:LowLevelTypeSystem
Check if type is a string subtype.- Specified by:
ll_isStringSubtype
in interfaceLowLevelTypeSystem
- Parameters:
type
- The type to be checked.- Returns:
true
ifftype
is a subtype of String.
-
ll_isRefType
public boolean ll_isRefType(int typeCode) Description copied from interface:LowLevelTypeSystem
Checks if the type code is that of a reference type (anything that's not a basic type, currently Integer, String, Float, Boolean, Byte, Short, Long, Double, and subtypes of String - specifying allowed-values).- Specified by:
ll_isRefType
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is the type code of a reference type.
-
getArrayType
Description copied from interface:TypeSystem
Obtain an array type with component typecomponentType
.- Specified by:
getArrayType
in interfaceTypeSystem
- Parameters:
componentType
- The type of the elements of the resulting array type. This can be any type, even another array type.- Returns:
- The array type with the corresponding component type.
-
ll_getTypeClass
public final int ll_getTypeClass(int typeCode) Description copied from interface:LowLevelTypeSystem
Determine the type class of a type. This is useful for generic CAS exploiters to determine what kind of data they're looking at. The type classes currently defined are:TYPE_CLASS_INVALID
-- Not a valid type code.TYPE_CLASS_INT
-- Integer type.TYPE_CLASS_FLOAT
-- Float type.TYPE_CLASS_STRING
-- String type.TYPE_CLASS_INTARRAY
-- Integer array.TYPE_CLASS_FLOATARRAY
-- Float array.TYPE_CLASS_STRINGARRAY
-- String array.TYPE_CLASS_FSARRAY
-- FS array.TYPE_CLASS_FS
-- FS type, i.e., all other types, including all user-defined types.
- Specified by:
ll_getTypeClass
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The type code.- Returns:
- A type class for the type code.
TYPE_CLASS_INVALID
if the type code argument does not represent a valid type code.
-
ll_getArrayType
public int ll_getArrayType(int componentTypeCode) Description copied from interface:LowLevelTypeSystem
Get the type code for the array type withcomponentTypeCode
as component type code.- Specified by:
ll_getArrayType
in interfaceLowLevelTypeSystem
- Parameters:
componentTypeCode
- The type code of the component type.- Returns:
- The type code for the requested array type, or
UNKNOWN_TYPE_CODE
ifcomponentTypeCode
is not a valid type code.
-
addArrayType
-
ll_addArrayType
int ll_addArrayType(int componentTypeCode, int motherCode) -
ll_isValidTypeCode
public boolean ll_isValidTypeCode(int typeCode) Description copied from interface:LowLevelTypeSystem
Check the input type code.- Specified by:
ll_isValidTypeCode
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- Type code to check.- Returns:
true
ifftypeCode
is a valid type code.
-
ll_isArrayType
public boolean ll_isArrayType(int typeCode) Description copied from interface:LowLevelTypeSystem
Check iftypeCode
is the type code of an array type.- Specified by:
ll_isArrayType
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is an array type code.
-
ll_getComponentType
public int ll_getComponentType(int arrayTypeCode) Description copied from interface:LowLevelTypeSystem
Get the component type of an array type code.- Specified by:
ll_getComponentType
in interfaceLowLevelTypeSystem
- Parameters:
arrayTypeCode
- The input array type code.- Returns:
- The type code for the component type, or
UNKNOWN_TYPE_CODE
ifarrayTypeCode
is not valid or not an array type.
-
ll_isPrimitiveType
public boolean ll_isPrimitiveType(int typeCode) Description copied from interface:LowLevelTypeSystem
Check iftypeCode
is the type code of a primitive type.- Specified by:
ll_isPrimitiveType
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is a primitive type code.
-
ll_getStringSet
Description copied from interface:LowLevelTypeSystem
Get the string set (sorted) for a string subtype.- Specified by:
ll_getStringSet
in interfaceLowLevelTypeSystem
- Parameters:
typeCode
- Input type code; should be a string subtype.- Returns:
- The set of allowable string values for subtypes of uima.cas.String. If the input type
code is not a proper subtype of String, returns
null
.
-
getTypeInfo
-
getTypeSystemMapper
CasTypeSystemMapper getTypeSystemMapper(TypeSystemImpl tgtTs) throws ResourceInitializationException - Throws:
ResourceInitializationException
-