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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LayoutManager
private boolean
private Object
private Iterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected void
endIter()
end (reset) iteratorprotected LayoutManager
protected Position
Default implementation assumes that the passednextObj
is itself aPosition
, and just returns it.boolean
hasNext()
private void
next()
peekNext()
void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
parentIter
-
nextObj
-
childLM
-
hasNext
private boolean hasNext
-
-
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.
-
lookAhead
private void lookAhead() -
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
-