Interface Type
-
- All Superinterfaces:
java.lang.Iterable<Feature>
- All Known Implementing Classes:
TypeImpl
,TypeImpl_annot
,TypeImpl_annotBase
,TypeImpl_array
,TypeImpl_list
,TypeImpl_primitive
,TypeImpl_string
,TypeImpl_stringSubtype
public interface Type extends java.lang.Iterable<Feature>
The interface describing types in the type system.Type names are Java strings that look like Java class names. For example, the built-in annotation type is called
uima.tcas.Annotation
. The whole string is called the (fully) qualified type name. The part after the last period is called the short or base name. The rest of the name is the name space of the type. This part can be empty, in which case the qualified and the base name are identical.Type system identifiers in general have the following syntax: they are non-empty strings whose first character is a letter (Unicode letter), followed by an arbitrary sequence of letters, digits and underscores. No other characters are legal parts of identifiers. A type name is then a non-empty sequence of identifiers separated by periods. See also Feature names.
Implements Iterable over all the features defined for this type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.util.Vector<Feature>
getAppropriateFeatures()
Deprecated.UsegetFeatures()
instead.Type
getComponentType()
For array types, returns the component type of the array type.Feature
getFeatureByBaseName(java.lang.String featureName)
Retrieve a feature for this type.java.util.List<Feature>
getFeatures()
Get a vector of the features for which this type is a subtype of the features' domain (i.e., inherited features are also returned).java.lang.String
getName()
Get the fully qualified name of the type.int
getNumberOfFeatures()
Get the number of features for which this type defines the domain.java.lang.String
getShortName()
Get the unqualified, short name of this type.boolean
isArray()
Check if the type is an array type.boolean
isFeatureFinal()
Check if type is feature final, i.e., if no more new features may be defined for it.boolean
isInheritanceFinal()
Check if type is inheritance final, i.e., if new types can be derived from it.boolean
isPrimitive()
Check if the type is one of the primitive types.boolean
isStringOrStringSubtype()
boolean
isStringSubtype()
Check if the type is a String subtype.default boolean
subsumes(Type subtype)
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get the fully qualified name of the type.- Returns:
- The name of the type.
-
getShortName
java.lang.String getShortName()
Get the unqualified, short name of this type.- Returns:
- The short name of this type.
-
getAppropriateFeatures
@Deprecated java.util.Vector<Feature> getAppropriateFeatures()
Deprecated.UsegetFeatures()
instead.Get a vector of the features for which this type is a subtype of the features' domain (i.e., inherited features are also returned). If you need to know which type introduces a feature, useFeature.getDomain
. Features will be listed in no particular order.- Returns:
- The Vector of features.
-
getFeatures
java.util.List<Feature> getFeatures()
Get a vector of the features for which this type is a subtype of the features' domain (i.e., inherited features are also returned). If you need to know which type introduces a feature, useFeature.getDomain
. Features will be listed in no particular order.- Returns:
- The List of features defined for this type.
-
getNumberOfFeatures
int getNumberOfFeatures()
Get the number of features for which this type defines the domain. This includes inherited features.- Returns:
- The number of features.
-
getFeatureByBaseName
Feature getFeatureByBaseName(java.lang.String featureName)
Retrieve a feature for this type. Inherited features can also be retrieved this way.- Parameters:
featureName
- The short, unqualified name of the feature.- Returns:
- The feature, if it exists;
null
, else.
-
isFeatureFinal
boolean isFeatureFinal()
Check if type is feature final, i.e., if no more new features may be defined for it.- Returns:
- If type is feature final.
-
isInheritanceFinal
boolean isInheritanceFinal()
Check if type is inheritance final, i.e., if new types can be derived from it.- Returns:
- If type is inheritance final.
-
isPrimitive
boolean isPrimitive()
Check if the type is one of the primitive types.- Returns:
true
iff type is a primitive type.
-
isArray
boolean isArray()
Check if the type is an array type.- Returns:
true
iff the type is an array type.
-
isStringSubtype
boolean isStringSubtype()
Check if the type is a String subtype. Note: returns false if a plain string- Returns:
true
iff the type is a String subtype type; false for plain string
-
isStringOrStringSubtype
boolean isStringOrStringSubtype()
- Returns:
- true if is a String or a StringSubtype
-
getComponentType
Type getComponentType()
For array types, returns the component type of the array type. For all other types, it will returnnull
.- Returns:
- The component type of an array type.
-
subsumes
default boolean subsumes(Type subtype)
- Parameters:
subtype
- - a UIMA Type- Returns:
- true if this type subsumes (is equal or a supertype of) the subtype argument
-
-