Package org.apache.fop.layoutmgr
Class PositionIterator
java.lang.Object
org.apache.fop.layoutmgr.PositionIterator
- Direct Known Subclasses:
KnuthPossPosIter
An iterator over
The
Position
instances, that is wrapped around
another 'parent' Iterator
. The parent can be either another
PositionIterator
, or an iterator over KnuthElement
s,
for example.The
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 Details
-
PositionIterator
Construct position iterator.- Parameters:
parentIter
- an iterator to use as parent
-
-
Method Details
-
getNextChildLM
- Returns:
- layout manager of next child layout manager or null
-
getLM
- Parameters:
nextObj
- next object from which to obtain position- Returns:
- layout manager
-
getPos
Default implementation assumes that the passednextObj
is itself aPosition
, and just returns it. Subclasses for which this is not the case, must provide a suitable override this method.- Parameters:
nextObj
- next object from which to obtain position- Returns:
- position of next object.
-
checkNext
protected boolean checkNext()- Returns:
- true if not at end of sub-sequence with same child layout manager
-
endIter
protected void endIter()end (reset) iterator -
hasNext
public boolean hasNext() -
next
- Specified by:
next
in interfaceIterator<Position>
- Throws:
NoSuchElementException
-
peekNext
- Returns:
- peek at next object
-
remove
- Specified by:
remove
in interfaceIterator<Position>
- Throws:
UnsupportedOperationException
-