org.apache.fop.fo

Class RecursiveCharIterator

Implemented Interfaces:
Cloneable, Iterator
Known Direct Subclasses:
InlineCharIterator

public class RecursiveCharIterator
extends CharIterator

Kind of a super-iterator that iterates through child nodes of an FONode, in turn managing character iterators for each of them. Caveat: Because this class is itself a CharIterator, and manages a collection of CharIterators, it is easy to get confused.

Constructor Summary

RecursiveCharIterator(FObj fobj)
Constructor which creates an iterator for all child nodes
RecursiveCharIterator(FObj fobj, FONode child)
Constructor which creates an iterator for only some child nodes

Method Summary

Object
clone()
boolean
hasNext()
CharIterator
mark()
char
nextChar()
void
remove()
void
replaceChar(char c)
Replaces the current character in the CharIterator with a specified character

Methods inherited from class org.apache.fop.fo.CharIterator

clone, hasNext, next, nextChar, remove, replaceChar

Constructor Details

RecursiveCharIterator

public RecursiveCharIterator(FObj fobj)
Constructor which creates an iterator for all child nodes
Parameters:
fobj - FONode for which an iterator should be created

RecursiveCharIterator

public RecursiveCharIterator(FObj fobj,
                             FONode child)
Constructor which creates an iterator for only some child nodes
Parameters:
fobj - FObj for which an iterator should be created
child - FONode of the first child to include in iterator

Method Details

clone

public Object clone()
Overrides:
clone in interface CharIterator
Returns:
a clone of this

hasNext

public boolean hasNext()
Overrides:
hasNext in interface CharIterator
Returns:
true if there are more items in the CharIterator

mark

public CharIterator mark()
Returns:
clone of this, cast as a CharIterator

nextChar

public char nextChar()
            throws NoSuchElementException
Overrides:
nextChar in interface CharIterator

remove

public void remove()
Overrides:
remove in interface CharIterator

replaceChar

public void replaceChar(char c)
Replaces the current character in the CharIterator with a specified character
Overrides:
replaceChar in interface CharIterator
Parameters:
c - the character which should be used to replace the current character

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.