Package org.apache.uima.cas.impl
Class TypeImpl
- java.lang.Object
-
- org.apache.uima.cas.impl.TypeImpl
-
- Direct Known Subclasses:
StringTypeImpl
public class TypeImpl extends java.lang.Object implements Type, java.lang.Comparable<TypeImpl>
The implementation of types in the type system.- Version:
- $Revision: 1.3 $
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(TypeImpl t)Note: you can only compare types from the same type system.java.util.Vector<Feature>getAppropriateFeatures()Deprecated.intgetCode()Return the internal integer code for this type.TypegetComponentType()For array types, returns the component type of the array type.FeaturegetFeature(java.lang.String featureName)Deprecated.FeaturegetFeatureByBaseName(java.lang.String featureName)Retrieve a feature for this type.java.util.List<Feature>getFeatures()guaranteed to be non-null, but might be empty listjava.lang.StringgetName()Get the name of the type.intgetNumberOfFeatures()Get the number of features for which this type defines the range.java.lang.StringgetShortName()Get the unqualified, short name of this type.TypegetSuperType()Get the super type.TypeSystemgetTypeSystem()Get the type hierarchy that this type belongs to.booleanisAnnotationType()Check if this is an annotation type.booleanisArray()Check if the type is an array type.booleanisFeatureFinal()Check if type is feature final, i.e., if no more new features may be defined for it.booleanisInheritanceFinal()Check if type is inheritance final, i.e., if new types can be derived from it.booleanisPrimitive()Check if the type is one of the primitive types.java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name of the type.
-
getSuperType
public Type getSuperType()
Get the super type.- Returns:
- The super type or null for Top.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getAppropriateFeatures
@Deprecated public java.util.Vector<Feature> 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:
getAppropriateFeaturesin interfaceType- Returns:
- The vector.
-
getNumberOfFeatures
public int getNumberOfFeatures()
Get the number of features for which this type defines the range.- Specified by:
getNumberOfFeaturesin interfaceType- Returns:
- The number of features.
-
isAnnotationType
public boolean isAnnotationType()
Check if this is an annotation type.- Returns:
true, ifthisis an annotation type;false, else.
-
getTypeSystem
public TypeSystem 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
public int compareTo(TypeImpl t)
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:
compareToin interfacejava.lang.Comparable<TypeImpl>
-
getFeatureByBaseName
public Feature getFeatureByBaseName(java.lang.String featureName)
Description copied from interface:TypeRetrieve a feature for this type. Inherited features can also be retrieved this way.- Specified by:
getFeatureByBaseNamein interfaceType- Parameters:
featureName- The short, unqualified name of the feature.- Returns:
- The feature, if it exists;
null, else. - See Also:
Type.getFeatureByBaseName(String)
-
getShortName
public java.lang.String getShortName()
Description copied from interface:TypeGet the unqualified, short name of this type.- Specified by:
getShortNamein interfaceType- Returns:
- The short name of this type.
- See Also:
Type.getShortName()
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:TypeCheck if the type is one of the primitive types.- Specified by:
isPrimitivein interfaceType- Returns:
trueiff type is a primitive type.- See Also:
Type.isPrimitive()
-
isFeatureFinal
public boolean isFeatureFinal()
Description copied from interface:TypeCheck if type is feature final, i.e., if no more new features may be defined for it.- Specified by:
isFeatureFinalin interfaceType- Returns:
- If type is feature final.
- See Also:
Type.isFeatureFinal()
-
isInheritanceFinal
public boolean isInheritanceFinal()
Description copied from interface:TypeCheck if type is inheritance final, i.e., if new types can be derived from it.- Specified by:
isInheritanceFinalin interfaceType- Returns:
- If type is inheritance final.
- See Also:
Type.isInheritanceFinal()
-
getFeature
@Deprecated public Feature getFeature(java.lang.String featureName)
Deprecated.- Parameters:
featureName- -- Returns:
- -
-
getFeatures
public java.util.List<Feature> getFeatures()
guaranteed to be non-null, but might be empty list- Specified by:
getFeaturesin interfaceType- Returns:
- -
-
isArray
public boolean isArray()
Description copied from interface:TypeCheck if the type is an array type.
-
getComponentType
public Type getComponentType()
Description copied from interface:TypeFor array types, returns the component type of the array type. For all other types, it will returnnull.- Specified by:
getComponentTypein interfaceType- Returns:
- The component type of an array type.
-
-