Package 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
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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Never called.SourceDocumentInformation
(int addr, TOP_Type type) Internal - constructor used by generatorSourceDocumentInformation
(JCas jcas, int begin, int end) -
Method Summary
Modifier and TypeMethodDescriptionint
getter for documentSize - gets Size of original document in bytes before processing by CAS Initializer.boolean
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
getter for offsetInSource - gets Byte offset of the start of document content within original source file or other input source.int
used to obtain reference to the TOP_Type instancegetUri()
getter for uri - gets URI of document.private void
Write your own initialization herevoid
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
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 Details
-
typeIndexID
public static final int typeIndexID -
type
public static final int type
-
-
Constructor Details
-
SourceDocumentInformation
protected SourceDocumentInformation()Never called. Disable default constructor -
SourceDocumentInformation
Internal - constructor used by generator- Parameters:
addr
- -type
- -
-
SourceDocumentInformation
- Parameters:
jcas
- -
-
SourceDocumentInformation
- 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 classAnnotation
- Returns:
- the type array index
-
readObject
private void readObject()Write your own initialization here -
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
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
-