diff options
Diffstat (limited to 'src/java/org/apache/fop/fo/CharIterator.java')
-rw-r--r-- | src/java/org/apache/fop/fo/CharIterator.java | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/fo/CharIterator.java b/src/java/org/apache/fop/fo/CharIterator.java index 9e8738587..69dce0602 100644 --- a/src/java/org/apache/fop/fo/CharIterator.java +++ b/src/java/org/apache/fop/fo/CharIterator.java @@ -15,35 +15,63 @@ */ /* $Id$ */ - + package org.apache.fop.fo; import java.util.Iterator; import java.util.NoSuchElementException; /** - * Interface for iterators that should iterate through a series of characters. - * Extends the java.util.Iterator interface with some additional functions - * useful for FOP's management of text. + * Abstract base class for iterators that should iterate through a series + * of characters. Extends the java.util.Iterator interface with some + * additional functions useful for FOP's management of text. */ -public interface CharIterator extends Iterator { +public abstract class CharIterator implements Iterator, Cloneable { + + /** + * @see java.util.Iterator#hasNext() + */ + public abstract boolean hasNext(); /** * @return the character that is the next character in the collection * @throws NoSuchElementException if there are no more characters (test for * this condition with java.util.Iterator.hasNext()). */ - char nextChar() throws NoSuchElementException ; + public abstract char nextChar() throws NoSuchElementException; + + /** + * @see java.util.Iterator#next() + */ + public Object next() throws NoSuchElementException { + return new Character(nextChar()); + } + + /** + * @see java.util.Iterator#remove() + */ + public void remove() { + throw new UnsupportedOperationException(); + } + /** * Replace the current character managed by the iterator with a specified * character? * @param c character */ - void replaceChar(char c); + public void replaceChar(char c) { + } /** - * @return cloned Object + * @see java.lang.Object#clone() */ - Object clone(); + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException ex) { + return null; + } + } } + |