Package org.apache.uima.cas.impl
Interface LowLevelTypeSystem
- All Known Implementing Classes:
TypeSystemImpl
public interface LowLevelTypeSystem
Low-level version of the type system APIs. Use in conjunction with the
LowLevelCAS
APIs.
Use LowLevelCAS.ll_getTypeSystem()
to access a low-level type system.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Feature code that is returned on unknown feature names.static final int
Type code that is returned on unknown type names. -
Method Summary
Modifier and TypeMethodDescriptionint[]
ll_getAppropriateFeatures
(int typeCode) Get an array of the feature codes for the features on 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.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.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 type1, int type2) Check subsumption between two types.
-
Field Details
-
UNKNOWN_TYPE_CODE
static final int UNKNOWN_TYPE_CODEType code that is returned on unknown type names.- See Also:
-
UNKNOWN_FEATURE_CODE
static final int UNKNOWN_FEATURE_CODEFeature code that is returned on unknown feature names.- See Also:
-
-
Method Details
-
ll_getCodeForTypeName
Get the type code for a given type name.- 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
Get the code of an existing type object.- Parameters:
type
- A type object.- Returns:
- The type code for the input type.
-
ll_getCodeForFeatureName
Get the feature code for a given feature name.- 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
Get the code for a given feature object.- Parameters:
feature
- A feature object.- Returns:
- The code for the feature.
-
ll_getTypeForCode
Get a type object for a given code.- Parameters:
typeCode
- The code of the type.- Returns:
- A type object, or
null
iftypeCode
is not a valid type code.
-
ll_getFeatureForCode
Get a feature object for a given code.- Parameters:
featureCode
- The code of the feature.- Returns:
- A feature object, or
null
iffeatureCode
is not a valid feature code.
-
ll_getAppropriateFeatures
int[] ll_getAppropriateFeatures(int typeCode) Get an array of the feature codes for the features on this type.- Parameters:
typeCode
- Input type code.- Returns:
- The array of appropriate features for
typeCode
.
-
ll_getDomainType
int ll_getDomainType(int featureCode) Get the domain type for a given feature.- Parameters:
featureCode
- Input feature code.- Returns:
- The domain type code for
featureCode
.
-
ll_getRangeType
int ll_getRangeType(int featureCode) Get the range type for a given feature.- Parameters:
featureCode
- Input feature code.- Returns:
- The range type code for
featureCode
.
-
ll_subsumes
boolean ll_subsumes(int type1, int type2) Check subsumption between two types.- Parameters:
type1
- -type2
- -- Returns:
true
ifftype1
subsumestype2
.
-
ll_getTypeClass
int ll_getTypeClass(int typeCode) 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.
- 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_isStringSubtype
boolean ll_isStringSubtype(int type) Check if type is a string subtype. Returns false for plain string- Parameters:
type
- The type to be checked.- Returns:
true
ifftype
is a subtype of String.
-
ll_isRefType
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).- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is the type code of a reference type.
-
ll_isArrayType
boolean ll_isArrayType(int typeCode) Check iftypeCode
is the type code of an array type.- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is an array type code.
-
ll_isPrimitiveType
boolean ll_isPrimitiveType(int typeCode) Check iftypeCode
is the type code of a primitive type.- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is a primitive type code.
-
ll_getArrayType
int ll_getArrayType(int componentTypeCode) Get the type code for the array type withcomponentTypeCode
as component type code.- 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.
-
ll_isValidTypeCode
boolean ll_isValidTypeCode(int typeCode) Check the input type code.- Parameters:
typeCode
- Type code to check.- Returns:
true
ifftypeCode
is a valid type code.
-
ll_getComponentType
int ll_getComponentType(int arrayTypeCode) Get the component type of an array type code.- 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_getParentType
int ll_getParentType(int typeCode) Get the parent type for the input type.- Parameters:
typeCode
- The type code we want the parent for.- Returns:
- The type code of the parent type.
-
ll_getStringSet
Get the string set (sorted) for a string subtype.- 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
.
-