Package org.apache.uima.cas.text
Interface AnnotationFS
- All Superinterfaces:
AnnotationBaseFS,Cloneable,FeatureStructure
- All Known Subinterfaces:
AnnotationImpl
- All Known Implementing Classes:
Annotation,DocumentAnnotation,SourceDocumentInformation
Interface for Annotation Feature Structures.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancoveredBy(int aBegin, int aEnd) default booleancoveredBy(AnnotationFS aOther) default booleancovering(int aBegin, int aEnd) default booleancovering(AnnotationFS aOther) default booleanfollowing(int aBegin, int aEnd) default booleanfollowing(AnnotationFS aOther) intgetBegin()Get the start position of the annotation as character offset into the text.Get the text covered by an annotation as a string.intgetEnd()Get the end position of the annotation as character offset into the text.default booleanoverlapping(int aBegin, int aEnd) default booleanoverlapping(AnnotationFS aOther) default booleanoverlappingAtBegin(int aBegin, int aEnd) default booleanoverlappingAtBegin(AnnotationFS aOther) default booleanoverlappingAtEnd(int aBegin, int aEnd) default booleanoverlappingAtEnd(AnnotationFS aOther) default booleanpreceding(int aBegin, int aEnd) default booleanpreceding(AnnotationFS aOther) voidsetBegin(int begin) Set the start position of the annotation as character offset into the text.voidsetEnd(int end) Set the end position of the annotation as character offset into the text.default voidtrim()Strips leading and trailing whitespace by increasing/decreasing the begin/end offsets.voidtrim(IntPredicate aPredicate) Strips leading and trailing characters matching the given predicate by increasing/decreasing the begin/end offsets.Methods inherited from interface org.apache.uima.cas.AnnotationBaseFS
getViewMethods inherited from interface org.apache.uima.cas.FeatureStructure
_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
-
Method Details
-
getBegin
int getBegin()Get the start position of the annotation as character offset into the text. The smallest possible start position is0, the offset of the first character in the text.- Returns:
- The start position.
-
getEnd
int getEnd()Get the end position of the annotation as character offset into the text. The end position points at the first character after the annotation, such that(getEnd()-getBegin()) == getCoveredText().length().- Returns:
- The end position.
-
setBegin
void setBegin(int begin) Set the start position of the annotation as character offset into the text. The smallest possible start position is0, the offset of the first character in the text.- Parameters:
begin- The start position.
-
setEnd
void setEnd(int end) Set the end position of the annotation as character offset into the text. The end position points at the first character after the annotation, such that(getEnd()-getBegin()) == getCoveredText().length().- Parameters:
end- The end position position.
-
getCoveredText
String getCoveredText()Get the text covered by an annotation as a string. IfdocTextis your document text andannotan annotation, thenannot.getCoveredText().equals(docText.substring(annot.getBegin(), annot.getEnd())).- Returns:
- the covered text.
-
trim
default void trim()Strips leading and trailing whitespace by increasing/decreasing the begin/end offsets. This method is aware of Unicode codepoints. It expects that the begin/end offsets point to valid codepoints. -
trim
Strips leading and trailing characters matching the given predicate by increasing/decreasing the begin/end offsets.- Parameters:
aPredicate- the predicate used to identify whether a given codepoint is whitespace.- See Also:
-
covering
default boolean covering(int aBegin, int aEnd) -
covering
-
coveredBy
default boolean coveredBy(int aBegin, int aEnd) -
coveredBy
-
overlapping
default boolean overlapping(int aBegin, int aEnd) -
overlapping
-
overlappingAtBegin
default boolean overlappingAtBegin(int aBegin, int aEnd) -
overlappingAtBegin
-
overlappingAtEnd
default boolean overlappingAtEnd(int aBegin, int aEnd) -
overlappingAtEnd
-
following
default boolean following(int aBegin, int aEnd) -
following
-
preceding
default boolean preceding(int aBegin, int aEnd) -
preceding
-