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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `UNKNOWN_FEATURE_CODE` Feature code that is returned on unknown feature names.
    `static int` | `UNKNOWN_TYPE_CODE` Type code that is returned on unknown type names.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `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 with `componentTypeCode` 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.
    `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.
    `Type` | `ll_getTypeForCode(int typeCode)` Get a type object for a given code.
    `boolean` | `ll_isArrayType(int typeCode)` Check if `typeCode` is the type code of an array type.
    `boolean` | `ll_isPrimitiveType(int typeCode)` Check if `typeCode` 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 Detail

    - #### UNKNOWN_TYPE_CODE

          static final int UNKNOWN_TYPE_CODE

      Type code that is returned on unknown type names.
      See Also:
        Constant Field Values

    - #### UNKNOWN_FEATURE_CODE

          static final int UNKNOWN_FEATURE_CODE

      Feature code that is returned on unknown feature names.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### ll_getCodeForTypeName

          int ll_getCodeForTypeName(String typeName)

      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

          int ll_getCodeForType(Type type)

      Get the code of an existing type object.
      Parameters:
        `type` - A type object.
      Returns:
        The type code for the input type.

    - #### ll_getCodeForFeatureName

          int ll_getCodeForFeatureName(String featureName)

      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

          int ll_getCodeForFeature(Feature feature)

      Get the code for a given feature object.
      Parameters:
        `feature` - A feature object.
      Returns:
        The code for the feature.

    - #### ll_getTypeForCode

          Type ll_getTypeForCode(int typeCode)

      Get a type object for a given code.
      Parameters:
        `typeCode` - The code of the type.
      Returns:
        A type object, or `null` if `typeCode` is not a valid type code.

    - #### ll_getFeatureForCode

          Feature ll_getFeatureForCode(int featureCode)

      Get a feature object for a given code.
      Parameters:
        `featureCode` - The code of the feature.
      Returns:
        A feature object, or `null` if `featureCode` 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` iff `type1` subsumes `type2`.

    - #### 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.
      This method is on the CAS, not the type system, since the specific properties of types are specific to the CAS. The type system does not know, for example, that the CAS treats arrays specially.
      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.
      Parameters:
        `type` - The type to be checked.
      Returns:
        `true` iff `type` 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` iff `typeCode` is the type code of a reference type.

    - #### ll_isArrayType

          boolean ll_isArrayType(int typeCode)

      Check if `typeCode` is the type code of an array type.
      Parameters:
        `typeCode` - The type code to check.
      Returns:
        `true` iff `typeCode` is an array type code.

    - #### ll_isPrimitiveType

          boolean ll_isPrimitiveType(int typeCode)

      Check if `typeCode` is the type code of a primitive type.
      Parameters:
        `typeCode` - The type code to check.
      Returns:
        `true` iff `typeCode` is a primitive type code.

    - #### ll_getArrayType

          int ll_getArrayType(int componentTypeCode)

      Get the type code for the array type with `componentTypeCode` 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` if `componentTypeCode` 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` iff `typeCode` 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` if `arrayTypeCode` 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

          String[] ll_getStringSet(int typeCode)

      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`.

Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.