Package org.apache.uima.cas.impl
Class TypeImpl
java.lang.Object
org.apache.uima.cas.impl.TypeImpl
- All Implemented Interfaces:
Comparable<TypeImpl>
,Type
- Direct Known Subclasses:
StringTypeImpl
The implementation of types in the type system.
- Version:
- $Revision: 1.3 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private boolean
private boolean
private final String
private final TypeSystemImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Note: you can only compare types from the same type system.Deprecated.int
getCode()
Return the internal integer code for this type.For array types, returns the component type of the array type.getFeature
(String featureName) Deprecated.getFeatureByBaseName
(String featureName) Retrieve a feature for this type.guaranteed to be non-null, but might be empty listgetName()
Get the name of the type.int
Get the number of features for which this type defines the range.Get the unqualified, short name of this type.Get the super type.Get the type hierarchy that this type belongs to.boolean
Check if this is an annotation type.boolean
isArray()
Check if the type is an array type.boolean
Check if type is feature final, i.e., if no more new features may be defined for it.boolean
Check if type is inheritance final, i.e., if new types can be derived from it.boolean
Check if the type is one of the primitive types.(package private) void
(package private) void
toString()
-
Field Details
-
name
-
code
private final int code -
ts
-
isFeatureFinal
private boolean isFeatureFinal -
isInheritanceFinal
private boolean isInheritanceFinal
-
-
Constructor Details
-
TypeImpl
TypeImpl(String name, int code, TypeSystemImpl ts) Create a new type. This should only be done by aTypeSystemImpl
.
-
-
Method Details
-
getName
Get the name of the type. -
getSuperType
Get the super type.- Returns:
- The super type or null for Top.
-
toString
-
getAppropriateFeatures
Deprecated.Get a vector of the features for which this type is the domain. Features will be returned in no particular order.- Specified by:
getAppropriateFeatures
in interfaceType
- Returns:
- The vector.
-
getNumberOfFeatures
public int getNumberOfFeatures()Get the number of features for which this type defines the range.- Specified by:
getNumberOfFeatures
in interfaceType
- Returns:
- The number of features.
-
isAnnotationType
public boolean isAnnotationType()Check if this is an annotation type.- Returns:
true
, ifthis
is an annotation type;false
, else.
-
getTypeSystem
Get the type hierarchy that this type belongs to.- Returns:
- The type hierarchy.
-
getCode
public int getCode()Return the internal integer code for this type. This is only useful if you want to work with the low-level API.- Returns:
- The internal code for this type,
>=0
.
-
compareTo
Note: you can only compare types from the same type system. If you compare types from different type systems, the result is undefined.- Specified by:
compareTo
in interfaceComparable<TypeImpl>
-
getFeatureByBaseName
Description copied from interface:Type
Retrieve a feature for this type. Inherited features can also be retrieved this way.- Specified by:
getFeatureByBaseName
in interfaceType
- Parameters:
featureName
- The short, unqualified name of the feature.- Returns:
- The feature, if it exists;
null
, else. - See Also:
-
getShortName
Description copied from interface:Type
Get the unqualified, short name of this type.- Specified by:
getShortName
in interfaceType
- Returns:
- The short name of this type.
- See Also:
-
isPrimitive
public boolean isPrimitive()Description copied from interface:Type
Check if the type is one of the primitive types.- Specified by:
isPrimitive
in interfaceType
- Returns:
true
iff type is a primitive type.- See Also:
-
isFeatureFinal
public boolean isFeatureFinal()Description copied from interface:Type
Check if type is feature final, i.e., if no more new features may be defined for it.- Specified by:
isFeatureFinal
in interfaceType
- Returns:
- If type is feature final.
- See Also:
-
isInheritanceFinal
public boolean isInheritanceFinal()Description copied from interface:Type
Check if type is inheritance final, i.e., if new types can be derived from it.- Specified by:
isInheritanceFinal
in interfaceType
- Returns:
- If type is inheritance final.
- See Also:
-
setFeatureFinal
void setFeatureFinal() -
setInheritanceFinal
void setInheritanceFinal() -
getFeature
Deprecated.- Parameters:
featureName
- -- Returns:
- -
-
getFeatures
guaranteed to be non-null, but might be empty list- Specified by:
getFeatures
in interfaceType
- Returns:
- -
-
isArray
public boolean isArray()Description copied from interface:Type
Check if the type is an array type. -
getComponentType
Description copied from interface:Type
For array types, returns the component type of the array type. For all other types, it will returnnull
.- Specified by:
getComponentType
in interfaceType
- Returns:
- The component type of an array type.
-