aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/PositionIterator.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
committerJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
commit29e8badcec8bd40eca2ef4940133f08eeefdda11 (patch)
tree7b44a2d058ae8a60ff278f5d26f243eb674e54c6 /src/java/org/apache/fop/layoutmgr/PositionIterator.java
parentc81729764a0692e9f5e31ec28722403b603ee5aa (diff)
downloadxmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.tar.gz
xmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.zip
Bugzilla #49733:
Resolved compilation (safe one), Checkstyle and many Javadoc warnings. Submitted by: Glenn Adams <glenn.at.skynav.com> Changes to patch: - Restored the deprecated Graphics2DAdapter method (to be removed after Barcode4J 2.1 is released). - Restored Renderer.startPageSequence(LineArea) pending discussion about removal. - build.xml: set max VM to 1024MB instead of 2048MB to allow for 32-bit JVMs. - build.xml: restored longer taskdef names. - Restored Checkstyle 4 file for people running older IDEs. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/PositionIterator.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/PositionIterator.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PositionIterator.java b/src/java/org/apache/fop/layoutmgr/PositionIterator.java
index b50035313..63ff8461a 100644
--- a/src/java/org/apache/fop/layoutmgr/PositionIterator.java
+++ b/src/java/org/apache/fop/layoutmgr/PositionIterator.java
@@ -22,6 +22,7 @@ package org.apache.fop.layoutmgr;
import java.util.Iterator;
import java.util.NoSuchElementException;
+/** A position iterator. */
public abstract class PositionIterator implements Iterator {
private Iterator parentIter;
@@ -29,12 +30,17 @@ public abstract class PositionIterator implements Iterator {
private LayoutManager childLM;
private boolean bHasNext;
+ /**
+ * Construct position iterator.
+ * @param pIter an iterator to use as parent
+ */
protected PositionIterator(Iterator pIter) {
parentIter = pIter;
lookAhead();
//checkNext();
}
+ /** @return layout manager of next child layout manager or null */
public LayoutManager getNextChildLM() {
// Move to next "segment" of iterator, ie: new childLM
if (childLM == null && nextObj != null) {
@@ -44,8 +50,16 @@ public abstract class PositionIterator implements Iterator {
return childLM;
}
+ /**
+ * @param nextObj next object from which to obtain position
+ * @return layout manager
+ */
protected abstract LayoutManager getLM(Object nextObj);
+ /**
+ * @param nextObj next object from which to obtain position
+ * @return position of next object
+ */
protected abstract Position getPos(Object nextObj);
private void lookAhead() {
@@ -57,6 +71,7 @@ public abstract class PositionIterator implements Iterator {
}
}
+ /** @return true if not at end of sub-sequence with same child layout manager */
protected boolean checkNext() {
LayoutManager lm = getLM(nextObj);
if (childLM == null) {
@@ -70,17 +85,20 @@ public abstract class PositionIterator implements Iterator {
return true;
}
+ /** end (reset) iterator */
protected void endIter() {
bHasNext = false;
nextObj = null;
childLM = null;
}
+ /** {@inheritDoc} */
public boolean hasNext() {
return (bHasNext && checkNext());
}
+ /** {@inheritDoc} */
public Object next() throws NoSuchElementException {
if (bHasNext) {
Object retObj = getPos(nextObj);
@@ -91,10 +109,12 @@ public abstract class PositionIterator implements Iterator {
}
}
+ /** @return peek at next object */
public Object peekNext() {
return nextObj;
}
+ /** {@inheritDoc} */
public void remove() throws UnsupportedOperationException {
throw new UnsupportedOperationException("PositionIterator doesn't support remove");
}