org.apache.uima.examples

## Class SourceDocumentInformation

- java.lang.Object
- - org.apache.uima.cas.impl.FeatureStructureImpl
  - - org.apache.uima.jcas.cas.TOP
    - - org.apache.uima.jcas.cas.AnnotationBase
      - - org.apache.uima.jcas.tcas.Annotation
        - - org.apache.uima.examples.SourceDocumentInformation

- All Implemented Interfaces:
    Cloneable, AnnotationBaseFS, FeatureStructure, AnnotationFS

      public class SourceDocumentInformation
      extends Annotation

  Stores detailed information about the original source document from which the current CAS was initialized. All information (like size) refers to the source document and not to the document in the CAS which may be converted and filtered by a CAS Initializer. For example this information will be written to the Semantic Search index so that the original document contents can be retrieved by queries. Updated by JCasGen Wed Nov 22 16:51:13 EST 2006 XML source: C:/alally/dev/workspace_apache/uimaj-examples/src/main/resources/org/apache/uima/examples/SourceDocumentInformation.xml

- - ### 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` | `SourceDocumentInformation()` Never called.
    `` | `SourceDocumentInformation(int addr, TOP_Type type)` Internal - constructor used by generator
    `` | `SourceDocumentInformation(JCas jcas)`
    `` | `SourceDocumentInformation(JCas jcas, int begin, int end)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getDocumentSize()` getter for documentSize - gets Size of original document in bytes before processing by CAS Initializer.
    `boolean` | `getLastSegment()` getter for lastSegment - gets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document.
    `int` | `getOffsetInSource()` getter for offsetInSource - gets Byte offset of the start of document content within original source file or other input source.
    `int` | `getTypeIndexID()` used to obtain reference to the TOP_Type instance
    `String` | `getUri()` getter for uri - gets URI of document.
    `void` | `setDocumentSize(int v)` setter for documentSize - sets Size of original document in bytes before processing by CAS Initializer.
    `void` | `setLastSegment(boolean v)` setter for lastSegment - sets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document.
    `void` | `setOffsetInSource(int v)` setter for offsetInSource - sets Byte offset of the start of document content within original source file or other input source.
    `void` | `setUri(String v)` setter for uri - sets URI of document.

    - ### Methods inherited from class org.apache.uima.jcas.tcas.Annotation

      `getBegin, getCoveredText, getEnd, getStart, setBegin, setEnd`

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

      `getSofa, getView`

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

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

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

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

      `getView`

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

- - ### Field Detail

    - #### typeIndexID

          public static final int typeIndexID

    - #### type

          public static final int type

  - ### Constructor Detail

    - #### SourceDocumentInformation

          protected SourceDocumentInformation()

      Never called. Disable default constructor

    - #### SourceDocumentInformation

          public SourceDocumentInformation(int addr,
                                           TOP_Type type)

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

    - #### SourceDocumentInformation

          public SourceDocumentInformation(JCas jcas)

      Parameters:
        `jcas` - -

    - #### SourceDocumentInformation

          public SourceDocumentInformation(JCas jcas,
                                           int begin,
                                           int end)

      Parameters:
        `jcas` - -
        `begin` - -
        `end` - -

  - ### Method Detail

    - #### getTypeIndexID

          public int getTypeIndexID()

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

    - #### getUri

          public String getUri()

      getter for uri - gets URI of document. (For example, file:///MyDirectory/myFile.txt for a simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
      Returns:
        the Uri

    - #### setUri

          public void setUri(String v)

      setter for uri - sets URI of document. (For example, file:///MyDirectory/myFile.txt for a simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
      Parameters:
        `v` - this document's Uri

    - #### getOffsetInSource

          public int getOffsetInSource()

      getter for offsetInSource - gets Byte offset of the start of document content within original source file or other input source. Only used if the CAS document was retrieved from an source where one physical source file contained several conceptual documents. Zero otherwise.
      Returns:
        the byte offset of the start of the document within the original

    - #### setOffsetInSource

          public void setOffsetInSource(int v)

      setter for offsetInSource - sets Byte offset of the start of document content within original source file or other input source. Only used if the CAS document was retrieved from an source where one physical source file contained several conceptual documents. Zero otherwise.
      Parameters:
        `v` - the byte offset of the start of the document within the original

    - #### getDocumentSize

          public int getDocumentSize()

      getter for documentSize - gets Size of original document in bytes before processing by CAS Initializer. Either absolute file size of size within file or other source.
      Returns:
        the document size in bytes

    - #### setDocumentSize

          public void setDocumentSize(int v)

      setter for documentSize - sets Size of original document in bytes before processing by CAS Initializer. Either absolute file size of size within file or other source.
      Parameters:
        `v` - the document size in bytes

    - #### getLastSegment

          public boolean getLastSegment()

      getter for lastSegment - gets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document. This is useful for downstream components that want to take some action after having seen all of the segments of a particular source document.
      Returns:
        true if this is the final segment

    - #### setLastSegment

          public void setLastSegment(boolean v)

      setter for lastSegment - sets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document. This is useful for downstream components that want to take some action after having seen all of the segments of a particular source document.
      Parameters:
        `v` - true if this is the last segment

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