|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface that allows one to iterate over intervals.
Apart for the usual methods of a (type-specific) iterator, it
has a special (optional) reset()
method that allows one to reset
the iterator: the exact meaning of this operation is decided by the
implementing classes. Typically, after a reset()
, one can
iterate over a new sequence.
This interface also specifies a method extent()
returning
a positive integer that is supposed to approximate the minimum possible
length of an interval returned by this iterator. This method returns -1
if this extent cannot be computed.
Method Summary | |
int |
extent()
Returns an approximation of a lower bound for the length of an interval returned by this iterator. |
Interval |
nextInterval()
Returns the next interval in the sequence. |
void |
reset()
Resets the internal state of this iterator for a new document. |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
Method Detail |
public Interval nextInterval()
A call to this method is equivalent to (Interval)next()
.
UnsupportedOperationException
- if this iterator has multiple indices.public void reset()
To reduce object creation, interval iterators are usually created in a lazy
fashion by document iterator when they are needed. However, this implies that
every time the document iterator is moved, some internal state of the interval iterator must be reset
(e.g., because on the new document some of the component interval iterators are now
IntervalIterators.TRUE
).
public int extent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |