public class Annotation extends AnnotationBase implements AnnotationImpl
FeatureStructureImplC.PrintReferences
Modifier and Type | Field and Description |
---|---|
static String |
_FeatName_begin |
static String |
_FeatName_end |
static String |
_TypeName |
static int |
type |
static int |
typeIndexID |
_FeatName_sofa
_singleton
_casView, _id, DISABLE_RUNTIME_FEATURE_VALIDATION, DISABLE_RUNTIME_FEATURE_VALUE_VALIDATION, IS_ENABLE_RUNTIME_FEATURE_VALIDATION, IS_ENABLE_RUNTIME_FEATURE_VALUE_VALIDATION, IS_V2_PRETTY_PRINT, V2_PRETTY_PRINT
Modifier | Constructor and Description |
---|---|
protected |
Annotation()
Deprecated.
|
|
Annotation(JCas jcas) |
|
Annotation(JCas jcas,
int begin,
int end)
Constructor with begin and end passed as arguments
|
|
Annotation(TypeImpl t,
CASImpl c)
used by generator
Make a new AnnotationBase
|
Modifier and Type | Method and Description |
---|---|
int |
compareAnnotation(Annotation other)
Compare two annotations, no type order
|
int |
compareAnnotation(Annotation other,
LinearTypeOrder lto)
Compare two annotations incl type order
|
int |
compareAnnotationWithId(Annotation other)
Compare two annotations, with id compare
|
int |
compareAnnotationWithId(Annotation other,
LinearTypeOrder lto)
Compare two annotations, with type order, with id compare
|
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.
Use
getBegin() instead. |
int |
getTypeIndexID() |
void |
setBegin(int v)
Set the start position of the annotation as character offset into the text.
|
void |
setEnd(int v)
Set the end position of the annotation as character offset into the text.
|
void |
trim(IntPredicate aIsTrimChar)
Strips leading and trailing characters matching the given predicate by increasing/decreasing
the begin/end offsets.
|
getSofa, getView, setFeatureValue
_createJCasHashMapReserve, _createSearchKey
_copyIntAndRefArraysEqTypesFrom, _copyIntAndRefArraysFrom, _copyIntArrayEqTypesFrom, _getBooleanValueNc, _getBooleanValueNc, _getByteValueNc, _getByteValueNc, _getDoubleValueNc, _getDoubleValueNc, _getFeatFromAdjOffset, _getFeatureValueNc, _getFeatureValueNc, _getFloatValueNc, _getFloatValueNc, _getIntLikeValue, _getIntValueNc, _getIntValueNc, _getLongValueNc, _getLongValueNc, _getRefValueCommon, _getShortValueNc, _getShortValueNc, _getStringValueNc, _getStringValueNc, _getTypeCode, _getTypeImpl, _getView, _id, _inSetSortedIndex, _isJCasHashMapReserve, _isPearTrampoline, _maybeGetBaseForPearFs, _maybeGetBaseForPearFs, _maybeGetPearFs, _maybeGetPearFs, _resetInSetSortedIndex, _setBooleanValueNcNj, _setBooleanValueNcNj, _setBooleanValueNfc, _setByteValueNcNj, _setByteValueNcNj, _setByteValueNfc, _setDoubleValueNcNj, _setDoubleValueNcNj, _setDoubleValueNfc, _setFeatureValueNcNj, _setFeatureValueNcNj, _setFeatureValueNcWj, _setFloatValueNcNj, _setFloatValueNcNj, _setFloatValueNfc, _setInSetSortedIndexed, _setIntLikeValue, _setIntLikeValueNcNj, _setIntValueCJ, _setIntValueNcNj, _setIntValueNcNj, _setIntValueNfc, _setIntValueNfcCJ, _setJCasHashMapReserve, _setLongValueCJ, _setLongValueNcNj, _setLongValueNcNj, _setLongValueNfc, _setLongValueNfcCJ, _setPearTrampoline, _setRefValueCJ, _setRefValueCommon, _setRefValueCommonWj, _setRefValueNfcCJ, _setShortValueNcNj, _setShortValueNcNj, _setShortValueNfc, _setStringValueNcNj, _setStringValueNcWj, _setStringValueNfc, _setTypeImpl, addStringOrPrimitive, addToIndexes, addToIndexes, addToIndexes, clone, compare, equals, getAddress, getBooleanValue, getByteValue, getCAS, getCASImpl, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getLongValue, getLowLevelCas, getShortValue, getStringValue, getType, hashCode, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrintShort, removeFromIndexes, removeFromIndexes, removeFromIndexes, setBooleanValue, setByteValue, setDoubleValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue, toShortString, toString, toString, wrapGetIntCatchException
finalize, getClass, notify, notifyAll, wait, wait, wait
coveredBy, coveredBy, covering, covering, following, following, overlapping, overlapping, overlappingAtBegin, overlappingAtBegin, overlappingAtEnd, overlappingAtEnd, preceding, preceding, trim
getView
_getTypeCode, _id, clone, equals, getAddress, getBooleanValue, getByteValue, getCAS, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getJCas, getLongValue, getShortValue, getStringValue, getType, hashCode, setBooleanValue, setByteValue, setDoubleValue, setFeatureValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue
prettyPrint, prettyPrint, prettyPrint, prettyPrint, toString
public static final String _TypeName
public static final String _FeatName_begin
public static final String _FeatName_end
public static final int typeIndexID
public static final int type
@Deprecated protected Annotation()
public Annotation(JCas jcas)
public Annotation(TypeImpl t, CASImpl c)
c
- -t
- -public Annotation(JCas jcas, int begin, int end)
jcas
- JCasbegin
- begin offsetend
- end offsetpublic int getTypeIndexID()
getTypeIndexID
in class AnnotationBase
public final int getBegin()
AnnotationFS
0
, the offset of the first character in the text.getBegin
in interface AnnotationFS
public final void setBegin(int v)
AnnotationFS
0
, the offset of the first character in the text.setBegin
in interface AnnotationFS
v
- The start position.public final int getEnd()
AnnotationFS
(getEnd()-getBegin()) == getCoveredText().length()
.getEnd
in interface AnnotationFS
public final void setEnd(int v)
AnnotationFS
(getEnd()-getBegin()) == getCoveredText().length()
.setEnd
in interface AnnotationFS
v
- The end position position.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()
instead.public final int compareAnnotation(Annotation other)
other
- -public final int compareAnnotation(Annotation other, LinearTypeOrder lto)
other
- -lto
- -public final int compareAnnotationWithId(Annotation other)
other
- -public final int compareAnnotationWithId(Annotation other, LinearTypeOrder lto)
other
- -lto
- -public void trim(IntPredicate aIsTrimChar)
AnnotationFS
trim
in interface AnnotationFS
aIsTrimChar
- the predicate used to identify whether a given codepoint is whitespace.AnnotationFS.trim()
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.