aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2011-02-06 00:56:28 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2011-02-06 00:56:28 +0000
commite8279d632fdf524b7e098113de93fce005bf65b2 (patch)
tree3a5099b1a1c23bc7de9748c4f8fa4dffba141d01 /src
parent4941b30967c894d294f5a0f3aa84c659e165d969 (diff)
downloadxmlgraphics-fop-e8279d632fdf524b7e098113de93fce005bf65b2.tar.gz
xmlgraphics-fop-e8279d632fdf524b7e098113de93fce005bf65b2.zip
Add type safety to LMiter
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1067558 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/LMiter.java14
1 files changed, 7 insertions, 7 deletions
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<LayoutManager> {
/** list of layout managers */
- protected List listLMs;
+ protected List<LayoutManager> 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");
}