org.apache.uima.jcas.tcas
Class Annotation

java.lang.Object
  extended by org.apache.uima.cas.impl.FeatureStructureImpl
      extended by org.apache.uima.jcas.cas.TOP
          extended by org.apache.uima.jcas.cas.AnnotationBase
              extended by org.apache.uima.jcas.tcas.Annotation
All Implemented Interfaces:
Cloneable, AnnotationBaseFS, FeatureStructure, AnnotationFS
Direct Known Subclasses:
DocumentAnnotation, SourceDocumentInformation

public class Annotation
extends AnnotationBase
implements AnnotationFS

the JCas class model for the CAS type uima.cas.Annotation. It defines two integer valued features indicating the begin and end of the span being annotated. There is also a method to retrieve the spanned text as a string.


Field Summary
static int type
           
static int typeIndexID
           
 
Fields inherited from class org.apache.uima.jcas.cas.TOP
addr, jcasType
 
Constructor Summary
protected Annotation()
           
  Annotation(int addr, TOP_Type type)
          Internal - Constructor used by generator
  Annotation(JCas jcas)
           
  Annotation(JCas jcas, int begin, int end)
          Constructor with begin and end passed as arguments
 
Method Summary
 int getBegin()
          getter for begin - gets beginning of span of annotation
 String getCoveredText()
          Get the text covered by an annotation as a string.
 int getEnd()
          getter for end - gets ending of span of annotation
 int getStart()
          Deprecated.  
 int getTypeIndexID()
          used to obtain reference to the TOP_Type instance
 void setBegin(int v)
          setter for begin - sets beginning of span of annotation
 void setEnd(int v)
          setter for end - sets ending of span of annotation
 
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, 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

Annotation

protected Annotation()

Annotation

public Annotation(int addr,
                  TOP_Type type)
Internal - Constructor used by generator


Annotation

public Annotation(JCas jcas)

Annotation

public Annotation(JCas jcas,
                  int begin,
                  int end)
Constructor with begin and end passed as arguments

Method Detail

getTypeIndexID

public int getTypeIndexID()
Description copied from class: TOP
used to obtain reference to the TOP_Type instance

Overrides:
getTypeIndexID in class AnnotationBase
Returns:
the type array index

getBegin

public int getBegin()
getter for begin - gets beginning of span of annotation

Specified by:
getBegin in interface AnnotationFS
Returns:
The start position.

setBegin

public void setBegin(int v)
setter for begin - sets beginning of span of annotation


getEnd

public int getEnd()
getter for end - gets ending of span of annotation

Specified by:
getEnd in interface AnnotationFS
Returns:
The end position.

setEnd

public void setEnd(int v)
setter for end - sets ending of span of annotation


getCoveredText

public String getCoveredText()
Description copied from interface: AnnotationFS
Get the text covered by an annotation as a string. If docText is your document text and annot an annotation, then annot.getCoveredText().equals(docText.substring(annot.getBegin(), annot.getEnd())).

Specified by:
getCoveredText in interface AnnotationFS
Returns:
String
See Also:
AnnotationFS.getCoveredText()

getStart

@Deprecated
public int getStart()
Deprecated. 



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