Class 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 Details

    • typeIndexID

      public static final int typeIndexID
    • type

      public static final int type
  • Constructor Details

    • 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 Details

    • 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
    • readObject

      private void readObject()
      Write your own initialization here
    • 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