Package com.attivio.sdk.token
Class PositionIterator
- java.lang.Object
-
- com.attivio.sdk.token.PositionIterator
-
public final class PositionIterator extends java.lang.Object implements java.util.Iterator<Position>, java.lang.Iterable<Position>
Iterates over all unique positions in a TokenList.WARNING: the Position instance returned by next() will always be the same reference. If you want to save positions as you are iterating, you should call Position.clone() on the returned position.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
get()
Get the current position.boolean
hasNext()
Returns true if a next position exists.PositionIterator
iterator()
Implement iterator() to return self (for Iterable interface).Position
next()
void
remove()
void
seek(Position p)
Expert: Seek to a position.
-
-
-
Method Detail
-
get
public Position get()
Get the current position.NOTE: this is undefined until
next()
has been called the first time.
-
seek
public void seek(Position p)
Expert: Seek to a position.
-
iterator
public PositionIterator iterator()
Implement iterator() to return self (for Iterable interface).- Specified by:
iterator
in interfacejava.lang.Iterable<Position>
-
hasNext
public boolean hasNext()
Returns true if a next position exists.- Specified by:
hasNext
in interfacejava.util.Iterator<Position>
-
remove
public final void remove()
- Specified by:
remove
in interfacejava.util.Iterator<Position>
-
-