From: Andreas L. Delmelle Date: Sun, 6 Feb 2011 00:56:28 +0000 (+0000) Subject: Add type safety to LMiter X-Git-Tag: fop-1_1rc1old~325 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e8279d632fdf524b7e098113de93fce005bf65b2;p=xmlgraphics-fop.git Add type safety to LMiter git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1067558 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java index 9f437df6a..d3ad30485 100644 --- a/src/java/org/apache/fop/layoutmgr/LMiter.java +++ b/src/java/org/apache/fop/layoutmgr/LMiter.java @@ -24,10 +24,10 @@ import java.util.ListIterator; import java.util.NoSuchElementException; /** An iterator for layout managers. */ -public class LMiter implements ListIterator { +public class LMiter implements ListIterator { /** list of layout managers */ - protected List listLMs; + protected List listLMs; /** current position in iteration */ protected int curPos = 0; /** The LayoutManager to which this LMiter is attached **/ @@ -44,7 +44,7 @@ public class LMiter implements ListIterator { /** {@inheritDoc} */ public boolean hasNext() { - return (curPos < listLMs.size()) ? true : lp.createNextChildLMs(curPos); + return (curPos < listLMs.size()) || lp.createNextChildLMs(curPos); } /** {@inheritDoc} */ @@ -53,7 +53,7 @@ public class LMiter implements ListIterator { } /** {@inheritDoc} */ - public Object previous() throws NoSuchElementException { + public LayoutManager previous() throws NoSuchElementException { if (curPos > 0) { return listLMs.get(--curPos); } else { @@ -62,7 +62,7 @@ public class LMiter implements ListIterator { } /** {@inheritDoc} */ - public Object next() throws NoSuchElementException { + public LayoutManager next() throws NoSuchElementException { if (curPos < listLMs.size()) { return listLMs.get(curPos++); } else { @@ -82,12 +82,12 @@ public class LMiter implements ListIterator { /** {@inheritDoc} */ - public void add(Object o) throws UnsupportedOperationException { + public void add(LayoutManager lm) throws UnsupportedOperationException { throw new UnsupportedOperationException("LMiter doesn't support add"); } /** {@inheritDoc} */ - public void set(Object o) throws UnsupportedOperationException { + public void set(LayoutManager lm) throws UnsupportedOperationException { throw new UnsupportedOperationException("LMiter doesn't support set"); }