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 Positionget()Get the current position.booleanhasNext()Returns true if a next position exists.PositionIteratoriterator()Implement iterator() to return self (for Iterable interface).Positionnext()voidremove()voidseek(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:
iteratorin interfacejava.lang.Iterable<Position>
-
hasNext
public boolean hasNext()
Returns true if a next position exists.- Specified by:
hasNextin interfacejava.util.Iterator<Position>
-
remove
public final void remove()
- Specified by:
removein interfacejava.util.Iterator<Position>
-
-