public interface HighlightsSequence
HighlightsContainer
.
Implementation: Any HighlightsSequence
obtained from any of the classes in
the Highlighting API will behave as so called fast-fail iterator. It
means that it will throw ConcurrentModificationException
from
its methods if the underlying data (highlights) have changed since when the instance
of the HighlightsSequence
was obtained.
Modifier and Type | Field and Description |
---|---|
static HighlightsSequence |
EMPTY
An empty
HighlightsSequence . |
Modifier and Type | Method and Description |
---|---|
AttributeSet |
getAttributes()
Gets the set of attributes that define how to render a current highlight.
|
int |
getEndOffset()
Gets the end offset of a current highlight.
|
int |
getStartOffset()
Gets the start offset of a current highlight.
|
boolean |
moveNext()
Moves the internal pointer to the next highlight in this sequence (if there is any).
|
static final HighlightsSequence EMPTY
HighlightsSequence
.boolean moveNext()
true
highlight's boundaries and attributes
can be retrieved by calling the getter methods.true
If there is a highlight available and it is safe
to call the getters.ConcurrentModificationException
- If the highlights this sequence is
iterating through have been changed since the creation of the sequence.int getStartOffset()
ConcurrentModificationException
- If the highlights this sequence is
iterating through have been changed since the creation of the sequence.int getEndOffset()
ConcurrentModificationException
- If the highlights this sequence is
iterating through have been changed since the creation of the sequence.AttributeSet getAttributes()
Since the AttributeSet
can contain any attributes implementors
must be aware of whether the attributes returned from this method affect
metrics or not and set the isFixedSize
parameter appropriately
when createing HighlightsLayer
s.
null
.ConcurrentModificationException
- If the highlights this sequence is
iterating through have been changed since the creation of the sequence.HighlightsLayer