public class Annotation extends AnnotationBase implements AnnotationFS
Modifier and Type | Field and Description |
---|---|
static int |
type |
static int |
typeIndexID |
Modifier | Constructor and Description |
---|---|
protected |
Annotation() |
|
Annotation(int addr,
TOP_Type type) |
|
Annotation(JCas jcas) |
|
Annotation(JCas jcas,
int begin,
int end)
Constructor with begin and end passed as arguments
|
Modifier and Type | Method and Description |
---|---|
int |
getBegin()
Get the start position of the annotation as character offset into the text.
|
String |
getCoveredText()
Get the text covered by an annotation as a string.
|
int |
getEnd()
Get the end position of the annotation as character offset into the text.
|
int |
getStart()
Deprecated.
|
int |
getTypeIndexID()
used to obtain reference to the TOP_Type instance
|
void |
setBegin(int v) |
void |
setEnd(int v) |
getSofa, getView
addToIndexes, addToIndexes, equals, getAddress, getCAS, getCASImpl, getLowLevelCas, hashCode, removeFromIndexes, removeFromIndexes
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
finalize, getClass, notify, notifyAll, wait, wait, wait
getView
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
protected Annotation()
public Annotation(int addr, TOP_Type type)
public Annotation(JCas jcas)
public Annotation(JCas jcas, int begin, int end)
jcas
- JCasbegin
- begin offsetend
- end offsetpublic int getTypeIndexID()
TOP
getTypeIndexID
in class AnnotationBase
public int getBegin()
AnnotationFS
0
, the offset of the first character in the text.getBegin
in interface AnnotationFS
public void setBegin(int v)
public int getEnd()
AnnotationFS
(getEnd()-getBegin()) == getCoveredText().length()
.getEnd
in interface AnnotationFS
public void setEnd(int v)
public String getCoveredText()
AnnotationFS
docText
is your document
text and annot
an annotation, then
annot.getCoveredText().equals(docText.substring(annot.getBegin(),
annot.getEnd()))
.getCoveredText
in interface AnnotationFS
AnnotationFS.getCoveredText()
@Deprecated public int getStart()
getBegin()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.