public class PositionIterator extends Object implements Iterator<Position>
Position instances, that is wrapped around
another 'parent' Iterator. The parent can be either another
PositionIterator, or an iterator over KnuthElements,
for example.next() method always returns a Position. The
getPos(Object) method can be overridden in subclasses
to take care of obtaining the LayoutManager or Position
from the object returned by the parent iterator's next() method.| Constructor and Description |
|---|
PositionIterator(Iterator parentIter)
Construct position iterator.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkNext() |
protected void |
endIter()
end (reset) iterator
|
protected LayoutManager |
getLM(Object nextObj) |
LayoutManager |
getNextChildLM() |
protected Position |
getPos(Object nextObj)
Default implementation assumes that the passed
nextObj is itself a Position, and just returns it. |
boolean |
hasNext() |
Position |
next() |
Object |
peekNext() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic PositionIterator(Iterator parentIter)
parentIter - an iterator to use as parentpublic LayoutManager getNextChildLM()
protected LayoutManager getLM(Object nextObj)
nextObj - next object from which to obtain positionprotected Position getPos(Object nextObj)
nextObj is itself a Position, and just returns it.
Subclasses for which this is not the case, must provide a
suitable override this method.nextObj - next object from which to obtain positionprotected boolean checkNext()
protected void endIter()
public Position next() throws NoSuchElementException
next in interface Iterator<Position>NoSuchElementExceptionpublic Object peekNext()
public void remove()
throws UnsupportedOperationException
remove in interface Iterator<Position>UnsupportedOperationExceptionCopyright © 2023 Apache Software Foundation. All rights reserved.