public interface AnnotationFS extends AnnotationBaseFS
Modifier and Type | Method and Description |
---|---|
default boolean |
coveredBy(AnnotationFS aOther) |
default boolean |
coveredBy(int aBegin,
int aEnd) |
default boolean |
covering(AnnotationFS aOther) |
default boolean |
covering(int aBegin,
int aEnd) |
default boolean |
following(AnnotationFS aOther) |
default boolean |
following(int aBegin,
int aEnd) |
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.
|
default boolean |
overlapping(AnnotationFS aOther) |
default boolean |
overlapping(int aBegin,
int aEnd) |
default boolean |
overlappingAtBegin(AnnotationFS aOther) |
default boolean |
overlappingAtBegin(int aBegin,
int aEnd) |
default boolean |
overlappingAtEnd(AnnotationFS aOther) |
default boolean |
overlappingAtEnd(int aBegin,
int aEnd) |
default boolean |
preceding(AnnotationFS aOther) |
default boolean |
preceding(int aBegin,
int aEnd) |
void |
setBegin(int begin)
Set the start position of the annotation as character offset into the text.
|
void |
setEnd(int end)
Set the end position of the annotation as character offset into the text.
|
default void |
trim()
Strips leading and trailing whitespace by increasing/decreasing the begin/end offsets.
|
void |
trim(IntPredicate aPredicate)
Strips leading and trailing characters matching the given predicate by increasing/decreasing
the begin/end offsets.
|
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
int getBegin()
0
, the offset of the first character in the text.int getEnd()
(getEnd()-getBegin()) == getCoveredText().length()
.void setBegin(int begin)
0
, the offset of the first character in the text.begin
- The start position.void setEnd(int end)
(getEnd()-getBegin()) == getCoveredText().length()
.end
- The end position position.String getCoveredText()
docText
is your document
text and annot
an annotation, then
annot.getCoveredText().equals(docText.substring(annot.getBegin(),
annot.getEnd()))
.default void trim()
void trim(IntPredicate aPredicate)
aPredicate
- the predicate used to identify whether a given codepoint is whitespace.trim()
default boolean covering(int aBegin, int aEnd)
default boolean covering(AnnotationFS aOther)
default boolean coveredBy(int aBegin, int aEnd)
default boolean coveredBy(AnnotationFS aOther)
default boolean overlapping(int aBegin, int aEnd)
default boolean overlapping(AnnotationFS aOther)
default boolean overlappingAtBegin(int aBegin, int aEnd)
default boolean overlappingAtBegin(AnnotationFS aOther)
default boolean overlappingAtEnd(int aBegin, int aEnd)
default boolean overlappingAtEnd(AnnotationFS aOther)
default boolean following(int aBegin, int aEnd)
default boolean following(AnnotationFS aOther)
default boolean preceding(int aBegin, int aEnd)
default boolean preceding(AnnotationFS aOther)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.