Package org.apache.uima.cas.impl

# Class FeatureImpl

java.lang.Object
org.apache.uima.cas.impl.FeatureImpl

All Implemented Interfaces:
  `Comparable<Feature>`, `Feature`

Direct Known Subclasses:
  `FeatureImpl_jcas_only`

public class FeatureImpl extends Object implements Feature
The implementation of features in the type system. A featureImpl instance is shared by the top defining type and all of its subtypes

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final boolean`
  `isAnnotBaseSofaRef`
  true for the feature which is the AnnotationBase sofa reference.
  `final boolean`
  `isInInt`
  `final boolean`
  `isLongOrDouble`
  true if the range is a long or double
  `final int`
  `rangeTypeClass`
  type class of the range, including CasSerializer List constants
  `static final FeatureImpl`
  `singleton`
  Used by CAS Copier to denote missing feature

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(Feature o)`
  This should work across different type systems, for instance when using filtered serialization
  `long`
  `computeHashCodeLong()`
  Hashcode and equals are used, possibly for features in different type systems, where the features should be "equal".
  `boolean`
  `equals(Object obj)`
  `int`
  `getAdjustedOffset()`
  `int`
  `getCode()`
  `Type`
  `getDomain()`
  Get the domain type for this feature.
  `String`
  `getName()`
  Get the fully qualified name for this feature.
  `int`
  `getOffset()`
  `Type`
  `getRange()`
  Get the range type for this feature.
  `TypeImpl`
  `getRangeImpl()`
  `String`
  `getShortName()`
  Get the unqualified, short name of this feature.
  `SlotKinds.SlotKind`
  `getSlotKind()`
  `int`
  `hashCode()`
  `long`
  `hashCodeLong()`
  `boolean`
  `isMultipleReferencesAllowed()`
  Checks if there can be multiple references to values of this feature.
  `String`
  `toString()`
  `void`
  `validateIsInAllowedValue(String v)`
  throw if v is not in the allowed value set of the range type

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### isInInt

    public final boolean isInInt

  - ### isLongOrDouble

    public final boolean isLongOrDouble
    true if the range is a long or double

  - ### isAnnotBaseSofaRef

    public final boolean isAnnotBaseSofaRef
    true for the feature which is the AnnotationBase sofa reference.

  - ### rangeTypeClass

    public final int rangeTypeClass
    type class of the range, including CasSerializer List constants

  - ### singleton

    public static final FeatureImpl singleton
    Used by CAS Copier to denote missing feature

- ## Method Details

  - ### getCode

    public int getCode()
    Returns:
      the internal code of this feature. Necessary when using low-level APIs.

  - ### getDomain

    public Type getDomain()
    Get the domain type for this feature.
    Specified by:
      `getDomain` in interface `Feature`
    Returns:
      The domain type. This can not be `null`.

  - ### getRange

    public Type getRange()
    Get the range type for this feature. * @return The range type. This can not be `null`.
    Specified by:
      `getRange` in interface `Feature`
    Returns:
      The range type. This can not be `null`.

  - ### getRangeImpl

    public TypeImpl getRangeImpl()

  - ### getSlotKind

    public SlotKinds.SlotKind getSlotKind()

  - ### getName

    public String getName()
    Get the fully qualified name for this feature. The Feature qualifier is that of the highest defining type.
    Specified by:
      `getName` in interface `Feature`
    Returns:
      The name. This can not be `null`.

  - ### getShortName

    public String getShortName()
    Description copied from interface: `Feature`
    Get the unqualified, short name of this feature.
    Specified by:
      `getShortName` in interface `Feature`
    Returns:
      The short name.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### isMultipleReferencesAllowed

    public boolean isMultipleReferencesAllowed()
    Description copied from interface: `Feature`
    Checks if there can be multiple references to values of this feature. This is only meaningful for array-valued or list-values features.

    If this is false it indicates that this feature has exclusive ownership of the array or list, so changes to the array or list are localized. If this is true it indicates that the array or list may be shared, so changes to it may affect other objects in the CAS.

    Specified by:
      `isMultipleReferencesAllowed` in interface `Feature`
    Returns:
      `true` iff the value type of this feature is an array or list and has been declared to allow multiple references.

  - ### getOffset

    public int getOffset()
    Returns:
      the 0-based offset for this feature

  - ### getAdjustedOffset

    public int getAdjustedOffset()

  - ### validateIsInAllowedValue

    public void validateIsInAllowedValue(String v)
    throw if v is not in the allowed value set of the range type
    Parameters:
      `v` - the value to check

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### hashCodeLong

    public long hashCodeLong()

  - ### computeHashCodeLong

    public long computeHashCodeLong()
    Hashcode and equals are used, possibly for features in different type systems, where the features should be "equal". Example: fitering during serialization.
    Returns:
      long version of hashcode

  - ### compareTo

    public int compareTo(Feature o)
    This should work across different type systems, for instance when using filtered serialization
    Specified by:
      `compareTo` in interface `Comparable<Feature>`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`