You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2016/01/02 21:53:51 UTC
svn commit: r1722664 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo:
FONode.java FObj.java
Author: adelmelle
Date: Sat Jan 2 20:53:51 2016
New Revision: 1722664
URL: http://svn.apache.org/viewvc?rev=1722664&view=rev
Log:
Slight improvement on previous commit: replace occurrence of ListIterator with FONodeIterator to avoid explicit cast + add base ListIterator methods to the FONodeIterator signature (to improve searching for usage in IDE)
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java?rev=1722664&r1=1722663&r2=1722664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java Sat Jan 2 20:53:51 2016
@@ -1017,6 +1017,43 @@ public abstract class FONode implements
*/
public interface FONodeIterator extends ListIterator<FONode> {
+ /** @return the next node */
+ FONode next();
+
+ /** @return the previous node */
+ FONode previous();
+
+ /**
+ * Replace the node at the current index with the given <code>newNode</code>.
+ *
+ * @param newNode the new node
+ */
+ void set(FONode newNode);
+
+ /**
+ * Add the given <code>newNode</code> at the current position.
+ *
+ * @param newNode the new node
+ */
+ void add(FONode newNode);
+
+ /** @return <code>true</code> if there is a next node, <code>false</code> otherwise */
+ boolean hasNext();
+
+ /** @return <code>true</code> if there is a previous node, <code>false</code> otherwise */
+ boolean hasPrevious();
+
+ /** @return the current index */
+ int nextIndex();
+
+ /** @return the previous index */
+ int previousIndex();
+
+ /**
+ * Removes the node at the current position.
+ */
+ void remove();
+
/**
* Returns the parent node for this iterator's list
* of child nodes
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=1722664&r1=1722663&r2=1722664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Sat Jan 2 20:53:51 2016
@@ -444,13 +444,13 @@ public abstract class FObj extends FONod
if (getLocator() != null) {
return super.gatherContextInfo();
} else {
- ListIterator iter = getChildNodes();
+ FONodeIterator iter = getChildNodes();
if (iter == null) {
return null;
}
StringBuilder sb = new StringBuilder();
while (iter.hasNext()) {
- FONode node = (FONode) iter.next();
+ FONode node = iter.next();
String s = node.gatherContextInfo();
if (s != null) {
if (sb.length() > 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org