Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.uima.cas
Interface SofaFS

All Superinterfaces:
  FeatureStructure

All Known Implementing Classes:
  Sofa

    public interface SofaFS

extends FeatureStructure

Interface for "Subject of Analysis" (Sofa) feature structures. A Sofa is implemented as a built-in CAS type uima.cas.Sofa. The features of the Sofa type include:

- SofaID: Every Sofa in a CAS must have a unique SofaID. SoaIDs are the primary handle or access.
- Mime type: This string feature can be used to describe the type of the data represented by the Sofa.
- Sofa Data: The data itself. This data can be resident in the CAS or it can be a reference to data outside the CAS.

To create a Sofa FS, use `CAS.createSofa()`. This interface provides methods to set the values of the features of the Sofa FS. Generic CAS APIs should never be used to create Sofas or set their features.

Sofa data can be contained locally in the CAS itself or it can be remote from CAS. To set the local Sofa data in the Sofa FS use: `SofaFS.setLocalSofaData()`. If the data is remote from the CAS use: `SofaFS.setRemoteSofaURI()`.

Once set, the Sofa data cannot be set again until the CAS has been reset. This is so that annotators cannot change the subject of analysis during processing.

Method Summary
`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.
`InputStream` | `getSofaDataStream()` Provides stream access to both local and remote Sofa data.
`String` | `getSofaID()` Get the Sofa globally unique name, after mapping.
`String` | `getSofaMime()` Get the Sofa mime type.
`int` | `getSofaRef()` Get the Sofa Ref value.
`String` | `getSofaURI()` Get the Sofa URI value.
`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.

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, setFeatureValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue`

Method Detail

### setRemoteSofaURI

    void setRemoteSofaURI(String aURI)
                          throws CASRuntimeException

  Set the URI for a Remote Subject of Analysis. Once set, this URI may not be changed.

  Throws:
    `CASRuntimeException` - if the Sofa data has already been set

### setLocalSofaData

    void setLocalSofaData(FeatureStructure aFS)
                          throws CASRuntimeException

  Set the Local Subject of Analysis to be a predefined ArrayFS. Once set, the Sofa data cannot be changed.

  Throws:
    `CASRuntimeException` - if given FS is not an ArrayFS, or if the Sofa data has already been set

### setLocalSofaData

    void setLocalSofaData(String aString)
                          throws CASRuntimeException

  Set the Local Subject of Analysis to be a String. Once set, the Sofa data cannot be changed.

  Throws:
    `CASRuntimeException` - if the Sofa data has already been set

### getLocalFSData

    FeatureStructure getLocalFSData()

  Get the Local Subject of Analysis returns null if not previously set.

### getLocalStringData

    String getLocalStringData()

  Get the Local Subject of Analysis returns null if not previously set.

### getSofaMime

    String getSofaMime()

  Get the Sofa mime type.

  Returns:
    SofA mime type

### getSofaID

    String getSofaID()

  Get the Sofa globally unique name, after mapping.

  Returns:
    Sofa globally unique name, after mapping

### getSofaURI

    String getSofaURI()

  Get the Sofa URI value.

  Returns:
    Sofa URI or null if not valid

### getSofaRef

    int getSofaRef()

  Get the Sofa Ref value.

### getSofaDataStream

    InputStream getSofaDataStream()

  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.

  Returns:
    an InputStream for reading Sofa data. null returned if there is no Sofa data.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007 The Apache Software Foundation. All Rights Reserved.