org.apache.uima.cas.impl

## Class FeatureStructureImpl

- java.lang.Object
- - org.apache.uima.cas.impl.FeatureStructureImpl

- All Implemented Interfaces:
    Cloneable, FeatureStructure
  Direct Known Subclasses:
    FeatureStructureImplC, TOP

      public abstract class FeatureStructureImpl
      extends Object
      implements FeatureStructure, Cloneable

  Feature structure implementation. This is the common super class of all Feature Structures including the JCAS (derived from TOP) and non JCas FSs
  Version:
    $Revision: 1.6 $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeatureStructureImpl()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()` Creates a copy of this feature structure.
    `abstract int` | `getAddress()`
    `int` | `getavoidcollisionTypeCode()`
    `boolean` | `getBooleanValue(Feature feat)` Get the boolean value of a feature.
    `byte` | `getByteValue(Feature feat)` Get the byte value of a feature.
    `protected abstract CASImpl` | `getCASImpl()`
    `double` | `getDoubleValue(Feature feat)` Get the double value of a feature.
    `FeatureStructure` | `getFeatureValue(Feature feat)` Get a feature value.
    `String` | `getFeatureValueAsString(Feature feat)` Get the value of the feature as a string if the type of the feature is one of the primitive type.
    `float` | `getFloatValue(Feature feat)` Get the float value of a feature.
    `int` | `getIntValue(Feature feat)` Get the int value of a feature.
    `long` | `getLongValue(Feature feat)` Get the long value of a feature.
    `short` | `getShortValue(Feature feat)` Get the short value of a feature.
    `String` | `getStringValue(Feature f)` Get the string value under a feature.
    `Type` | `getType()` Get the type of this FS.
    `void` | `prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames)`
    `void` | `prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s)`
    `void` | `prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s, org.apache.uima.cas.impl.FeatureStructureImpl.PrintReferences printRefs)`
    `void` | `setBooleanValue(Feature feat, boolean b)` Set the boolean value of a feature.
    `void` | `setByteValue(Feature feat, byte val)` Set the byte (8 bit) value of a feature.
    `void` | `setDoubleValue(Feature feat, double val)` Set the double value of a feature.
    `void` | `setFeatureValue(Feature feat, FeatureStructure fs)` Set a feature value to another FS.
    `void` | `setFeatureValueFromString(Feature feat, String s)` Sets the value of a feature from a string input if the feature type is one of the primitive types.
    `void` | `setFloatValue(Feature feat, float val)` Set the float value of a feature.
    `void` | `setIntValue(Feature feat, int val)` Set the int value of a feature.
    `void` | `setLongValue(Feature feat, long val)` Set the long (64 bit) value of a feature.
    `void` | `setShortValue(Feature feat, short val)` Set the short (16 bit) value of a feature.
    `void` | `setStringValue(Feature feat, String val)` Set the string value of a feature.
    `String` | `toString()`
    `String` | `toString(int indent)`

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

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.uima.cas.FeatureStructure

      `equals, getCAS, hashCode`

- - ### Constructor Detail

    - #### FeatureStructureImpl

          public FeatureStructureImpl()

  - ### Method Detail

    - #### getAddress

          public abstract int getAddress()

    - #### getCASImpl

          protected abstract CASImpl getCASImpl()

    - #### getType

          public Type getType()

      Description copied from interface: `FeatureStructure`
      Get the type of this FS.
      Specified by:
        `getType` in interface `FeatureStructure`
      Returns:
        The type.

    - #### getavoidcollisionTypeCode

          public int getavoidcollisionTypeCode()

    - #### setFeatureValue

          public void setFeatureValue(Feature feat,
                                      FeatureStructure fs)

      Description copied from interface: `FeatureStructure`
      Set a feature value to another FS.
      Specified by:
        `setFeatureValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value should be set.
        `fs` - The value FS.

    - #### setIntValue

          public void setIntValue(Feature feat,
                                  int val)

      Description copied from interface: `FeatureStructure`
      Set the int value of a feature.
      Specified by:
        `setIntValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The int we're setting the feature to.

    - #### setFloatValue

          public void setFloatValue(Feature feat,
                                    float val)

      Description copied from interface: `FeatureStructure`
      Set the float value of a feature.
      Specified by:
        `setFloatValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The float we're setting the feature to.

    - #### setStringValue

          public void setStringValue(Feature feat,
                                     String val)

      Description copied from interface: `FeatureStructure`
      Set the string value of a feature.
      Specified by:
        `setStringValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The string we're setting the feature to.

    - #### setByteValue

          public void setByteValue(Feature feat,
                                   byte val)
                            throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Set the byte (8 bit) value of a feature.
      Specified by:
        `setByteValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The 8bit value we're setting the feature to.
      Throws:
        `CASRuntimeException` - tbd

    - #### setBooleanValue

          public void setBooleanValue(Feature feat,
                                      boolean b)
                               throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Set the boolean value of a feature.
      Specified by:
        `setBooleanValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `b` - The boolean value we're setting the feature to.
      Throws:
        `CASRuntimeException`

    - #### setShortValue

          public void setShortValue(Feature feat,
                                    short val)
                             throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Set the short (16 bit) value of a feature.
      Specified by:
        `setShortValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The short (16bit) value we're setting the feature to.
      Throws:
        `CASRuntimeException`

    - #### setLongValue

          public void setLongValue(Feature feat,
                                   long val)
                            throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Set the long (64 bit) value of a feature.
      Specified by:
        `setLongValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The long (64bit) value we're setting the feature to.
      Throws:
        `CASRuntimeException`

    - #### setDoubleValue

          public void setDoubleValue(Feature feat,
                                     double val)
                              throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Set the double value of a feature.
      Specified by:
        `setDoubleValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The double value we're setting the feature to.
      Throws:
        `CASRuntimeException`

    - #### setFeatureValueFromString

          public void setFeatureValueFromString(Feature feat,
                                                String s)
                                         throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Sets the value of a feature from a string input if the feature type is one of the primitive types.
      Specified by:
        `setFeatureValueFromString` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
        `s` - The string value that the feature will be set to.
      Throws:
        `CASRuntimeException` - If `feat` is not a primitive type or the value cannot be converted to this type.

    - #### getFeatureValue

          public FeatureStructure getFeatureValue(Feature feat)
                                           throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get a feature value.
      Specified by:
        `getFeatureValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value; may be `null` if the value has not been set.
      Throws:
        `CASRuntimeException` - If there is a typing violation, i.e., if `feat` is not defined for the type of this FS, or the range type of `feat` is Float, Integer or String.

    - #### getIntValue

          public int getIntValue(Feature feat)

      Description copied from interface: `FeatureStructure`
      Get the int value of a feature. This method will throw an exception if the feature is not int valued.
      Specified by:
        `getIntValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value int; `0` if the value has not been set.

    - #### getFloatValue

          public float getFloatValue(Feature feat)
                              throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the float value of a feature. This method will throw an exception if the feature is not float valued.
      Specified by:
        `getFloatValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value float; `0.0` if the value has not been set.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if it is not float valued.

    - #### getStringValue

          public String getStringValue(Feature f)
                                throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the string value under a feature.
      Specified by:
        `getStringValue` in interface `FeatureStructure`
      Parameters:
        `f` - The feature for which we want the value.
      Returns:
        The value of this feature; may be `null` if the value has not been set.
      Throws:
        `CASRuntimeException` - If there is a typing violation, i.e., if `f` is not defined for the type of this feature structure, or if the range type of `f` is not String.

    - #### getByteValue

          public byte getByteValue(Feature feat)
                            throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the byte value of a feature. This method will throw an exception if the feature is not byte valued.
      Specified by:
        `getByteValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to set.
      Returns:
        The value byte; `0` if the value has not been set.
      Throws:
        `CASRuntimeException` - tbd

    - #### getBooleanValue

          public boolean getBooleanValue(Feature feat)
                                  throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the boolean value of a feature. This method will throw an exception if the feature is not boolean valued.
      Specified by:
        `getBooleanValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value int; `0` if the value has not been set.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if it is not boolean valued.

    - #### getShortValue

          public short getShortValue(Feature feat)
                              throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the short value of a feature. This method will throw an exception if the feature is not short valued.
      Specified by:
        `getShortValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value int; `0` if the value has not been set.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if it is not short valued.

    - #### getLongValue

          public long getLongValue(Feature feat)
                            throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the long value of a feature. This method will throw an exception if the feature is not long valued.
      Specified by:
        `getLongValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value int; `0` if the value has not been set.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if it is not long valued.

    - #### getDoubleValue

          public double getDoubleValue(Feature feat)
                                throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the double value of a feature. This method will throw an exception if the feature is not double valued.
      Specified by:
        `getDoubleValue` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get.
      Returns:
        The value int; `0` if the value has not been set.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if it is not double valued.

    - #### getFeatureValueAsString

          public String getFeatureValueAsString(Feature feat)
                                         throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Get the value of the feature as a string if the type of the feature is one of the primitive type.
      Specified by:
        `getFeatureValueAsString` in interface `FeatureStructure`
      Parameters:
        `feat` - The feature whose value we want to get and whose type is one of the primitve types.
      Returns:
        A string representation of the feature value.
      Throws:
        `CASRuntimeException` - If `feat` is not defined for the type of this FS, or if the type is not a primitive type.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(int indent)

    - #### prettyPrint

          public void prettyPrint(int indent,
                                  int incr,
                                  StringBuffer buf,
                                  boolean useShortNames)

    - #### prettyPrint

          public void prettyPrint(int indent,
                                  int incr,
                                  StringBuffer buf,
                                  boolean useShortNames,
                                  String s)

    - #### prettyPrint

          public void prettyPrint(int indent,
                                  int incr,
                                  StringBuffer buf,
                                  boolean useShortNames,
                                  String s,
                                  org.apache.uima.cas.impl.FeatureStructureImpl.PrintReferences printRefs)

    - #### clone

          public Object clone()
                       throws CASRuntimeException

      Description copied from interface: `FeatureStructure`
      Creates a copy of this feature structure. The returned feature structure is a new and separate object but all features of the feature structure which are not of builtin types (integer, float, string) will be shared between the clone and it's source FS.
      Specified by:
        `clone` in interface `FeatureStructure`
      Overrides:
        `clone` in class `Object`
      Returns:
        a FeatureStructure that is the cloned copy of this FeatureStructure.
      Throws:
        `CASRuntimeException` - passthru

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