Package org.apache.uima.cas

# Interface Type

All Superinterfaces:
  `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 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

  Modifier and Type
  Method
  Description
  `Vector<Feature>`
  `getAppropriateFeatures()`
  Deprecated.
  Use `getFeatures()` instead.
  `Type`
  `getComponentType()`
  For array types, returns the component type of the array type.
  `Feature`
  `getFeatureByBaseName(String featureName)`
  Retrieve a feature for this type.
  `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).
  `String`
  `getName()`
  Get the fully qualified name of the type.
  `int`
  `getNumberOfFeatures()`
  Get the number of features for which this type defines the domain.
  `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)`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, iterator, spliterator`

- ## Method Details

  - ### getName

    String getName()
    Get the fully qualified name of the type.
    Returns:
      The name of the type.

  - ### getShortName

    String getShortName()
    Get the unqualified, short name of this type.
    Returns:
      The short name of this type.

  - ### getAppropriateFeatures

    @Deprecated Vector<Feature> getAppropriateFeatures()
    Deprecated.
    Use `getFeatures()` 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, use `Feature.getDomain`. Features will be listed in no particular order.
    Returns:
      The Vector of features.

  - ### getFeatures

    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, use `Feature.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(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 return `null`.
    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