org.apache.uima.jcas.cas

## Class Sofa

- java.lang.Object
- - org.apache.uima.cas.impl.FeatureStructureImpl
  - - org.apache.uima.jcas.cas.TOP
    - - org.apache.uima.jcas.cas.Sofa

- All Implemented Interfaces:
    Cloneable, FeatureStructure, SofaFS

      public class Sofa
      extends TOP
      implements SofaFS

  Updated by JCasGen Fri Apr 29 16:05:04 EDT 2005

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `type`
    `static int` | `typeIndexID`

    - ### Fields inherited from class org.apache.uima.jcas.cas.TOP

      `addr, jcasType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Sofa()` Never called.
    `` | `Sofa(int addr, TOP_Type type)` Internal - constructor used by generator
    `` | `Sofa(JCas jcas, SofaID ID, String mimeType)` Deprecated. As of v2.0, use `JCasImpl.createView(String)` to create a view, which will also create the Sofa for that view.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FeatureStructure` | `getLocalFSData()` Get the Local Subject of Analysis returns null if not previously set.
    `String` | `getLocalStringData()` Get the Local Subject of Analysis returns null if not previously set.
    `String` | `getMimeType()` getter for mimeType - gets
    `InputStream` | `getSofaDataStream()` Provides stream access to both local and remote Sofa data.
    `String` | `getSofaID()` getter for sofaID - gets
    `String` | `getSofaMime()` Get the Sofa mime type.
    `int` | `getSofaNum()` getter for sofaNum - gets
    `int` | `getSofaRef()` Get the Sofa Ref value.
    `String` | `getSofaURI()` Get the Sofa URI value.
    `int` | `getTypeIndexID()` used to obtain reference to the TOP_Type instance
    `void` | `setFeatureValue(Feature feat, FeatureStructure fs)` Set a feature value to another FS.
    `void` | `setIntValue(Feature feat, Integer val)`
    `void` | `setLocalSofaData(FeatureStructure aFS)` Set the Local Subject of Analysis to be a predefined ArrayFS.
    `void` | `setLocalSofaData(String aString)` Set the Local Subject of Analysis to be a String.
    `void` | `setRemoteSofaURI(String aURI)` Set the URI for a Remote Subject of Analysis.
    `void` | `setStringValue(Feature feat, String val)` Set the string value of a feature.

    - ### Methods inherited from class org.apache.uima.jcas.cas.TOP

      `addToIndexes, addToIndexes, equals, getAddress, getCAS, getCASImpl, getLowLevelCas, hashCode, removeFromIndexes, removeFromIndexes`

    - ### Methods inherited from class org.apache.uima.cas.impl.FeatureStructureImpl

      `clone, getavoidcollisionTypeCode, getBooleanValue, getByteValue, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getLongValue, getShortValue, getStringValue, getType, prettyPrint, prettyPrint, prettyPrint, setBooleanValue, setByteValue, setDoubleValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, toString, toString`

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

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

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

      `clone, equals, getBooleanValue, getByteValue, getCAS, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getLongValue, getShortValue, getStringValue, getType, hashCode, setBooleanValue, setByteValue, setDoubleValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue`

- - ### Field Detail

    - #### typeIndexID

          public static final int typeIndexID

    - #### type

          public static final int type

  - ### Constructor Detail

    - #### Sofa

          protected Sofa()

      Never called. Disable default constructor

    - #### Sofa

          public Sofa(int addr,
                      TOP_Type type)

      Internal - constructor used by generator
      Parameters:
        `addr` - the address
        `type` - the type

    - #### Sofa

          @Deprecated
          public Sofa(JCas jcas,
                                  SofaID ID,
                                  String mimeType)

      Deprecated. As of v2.0, use `JCasImpl.createView(String)` to create a view, which will also create the Sofa for that view.
      Parameters:
        `jcas` - JCas
        `ID` - the sofa ID
        `mimeType` - the mime type

  - ### Method Detail

    - #### getTypeIndexID

          public int getTypeIndexID()

      Description copied from class: `TOP`
      used to obtain reference to the TOP_Type instance
      Overrides:
        `getTypeIndexID` in class `TOP`
      Returns:
        the type array index

    - #### getSofaNum

          public int getSofaNum()

      getter for sofaNum - gets
      Returns:
        the sofa number

    - #### getSofaID

          public String getSofaID()

      getter for sofaID - gets
      Specified by:
        `getSofaID` in interface `SofaFS`
      Returns:
        Sofa globally unique name, after mapping

    - #### getMimeType

          public String getMimeType()

      getter for mimeType - gets
      Returns:
        the mime type

    - #### setLocalSofaData

          public void setLocalSofaData(FeatureStructure aFS)

      Description copied from interface: `SofaFS`
      Set the Local Subject of Analysis to be a predefined ArrayFS. Once set, the Sofa data cannot be changed.
      Specified by:
        `setLocalSofaData` in interface `SofaFS`
      Parameters:
        `aFS` - the SofA
      See Also:
        `This method is duplicated in SofaFSImpl. Any changes should be made in both places.`

    - #### setLocalSofaData

          public void setLocalSofaData(String aString)

      Description copied from interface: `SofaFS`
      Set the Local Subject of Analysis to be a String. Once set, the Sofa data cannot be changed.
      Specified by:
        `setLocalSofaData` in interface `SofaFS`
      Parameters:
        `aString` - The subject of analysis
      See Also:
        `This method is duplicated in SofaFSImpl. Any changes should be made in both places.`

    - #### getLocalFSData

          public FeatureStructure getLocalFSData()

      Description copied from interface: `SofaFS`
      Get the Local Subject of Analysis returns null if not previously set.
      Specified by:
        `getLocalFSData` in interface `SofaFS`
      Returns:
        the local SofA
      See Also:
        `This method is duplicated in SofaFSImpl. Any changes should be made in both places.`

    - #### getLocalStringData

          public String getLocalStringData()

      Description copied from interface: `SofaFS`
      Get the Local Subject of Analysis returns null if not previously set.
      Specified by:
        `getLocalStringData` in interface `SofaFS`
      Returns:
        the SofA
      See Also:
        `This method is duplicated in SofaFSImpl. Any changes should be made in both places.`

    - #### setRemoteSofaURI

          public void setRemoteSofaURI(String aURI)

      Description copied from interface: `SofaFS`
      Set the URI for a Remote Subject of Analysis. Once set, this URI may not be changed.
      Specified by:
        `setRemoteSofaURI` in interface `SofaFS`
      Parameters:
        `aURI` - the URI for a remote Sofa
      See Also:
        `This method is duplicated in SofaFSImpl. Any changes should be made in both places.`

    - #### 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`
      Overrides:
        `setStringValue` in class `FeatureStructureImpl`
      Parameters:
        `feat` - The feature whose value we want to set.
        `val` - The string we're setting the feature to.

    - #### 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`
      Overrides:
        `setFeatureValue` in class `FeatureStructureImpl`
      Parameters:
        `feat` - The feature whose value should be set.
        `fs` - The value FS.

    - #### setIntValue

          public void setIntValue(Feature feat,
                                  Integer val)

    - #### getSofaMime

          public String getSofaMime()

      Description copied from interface: `SofaFS`
      Get the Sofa mime type.
      Specified by:
        `getSofaMime` in interface `SofaFS`
      Returns:
        SofA mime type

    - #### getSofaURI

          public String getSofaURI()

      Description copied from interface: `SofaFS`
      Get the Sofa URI value.
      Specified by:
        `getSofaURI` in interface `SofaFS`
      Returns:
        Sofa URI or null if not valid

    - #### getSofaRef

          public int getSofaRef()

      Description copied from interface: `SofaFS`
      Get the Sofa Ref value.
      Specified by:
        `getSofaRef` in interface `SofaFS`
      Returns:
        the Sofa Reference value

    - #### getSofaDataStream

          public InputStream getSofaDataStream()

      Description copied from interface: `SofaFS`
      Provides stream access to both local and remote Sofa data. For remote SofA data, a custom URLStreamHandler may be registered for a protocol via the java.protocol.handler.pkgs system property.
      Specified by:
        `getSofaDataStream` in interface `SofaFS`
      Returns:
        an InputStream for reading Sofa data. null returned if there is no Sofa data.

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