com.caucho.quercus.lib.spl
Class RecursiveIteratorIterator

java.lang.Object
  extended by com.caucho.quercus.lib.spl.RecursiveIteratorIterator
All Implemented Interfaces:
Iterator, OuterIterator, Traversable

public class RecursiveIteratorIterator
extends java.lang.Object
implements OuterIterator


Field Summary
static int CATCH_GET_CHILD
           
static int CHILD_FIRST
           
static int LEAVES_ONLY
           
static int SELF_FIRST
           
 
Constructor Summary
RecursiveIteratorIterator(Env env, ObjectValue iter, int mode, int flags)
           
 
Method Summary
 void beginChildren()
          Template method provided for overriding classes, called right after getChildren() and rewind() on the child, default implemenation does nothing.
 void beginIteration()
          Template method provided for overriding classes, default implementation does nothing.
 Value callGetChildren()
          Returns current iterator's children.
 boolean callHasChildren()
          Returns true if current iterator children.
 Value current()
          Returns the current value.
 void endChildren()
          Template method provided for overriding classes, called after an iteterator has been used up.
 void endIteration()
          Template method provided for overriding classe, default implementation does nothing.
 int getDepth()
          Returns the current depth.
 ObjectValue getInnerIterator()
           
 int getMaxDepth()
          Returns the maximum depth.
 Value getSubIterator(int depth)
          Returns the iterator at the given depth
 Value key()
          Returns the current key.
 void next()
          Advances to the next row.
 void nextElement()
          Template method provided for overriding classes, called when the next element is available
 void rewind()
          Rewind to the first iterator, calling endChildren() along the way as appropriate.
 void setMaxDepth(int maxDepth)
          Sets the maximum depth.
 boolean valid()
          Return true if the iterator is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEAVES_ONLY

public static final int LEAVES_ONLY
See Also:
Constant Field Values

SELF_FIRST

public static final int SELF_FIRST
See Also:
Constant Field Values

CHILD_FIRST

public static final int CHILD_FIRST
See Also:
Constant Field Values

CATCH_GET_CHILD

public static final int CATCH_GET_CHILD
See Also:
Constant Field Values
Constructor Detail

RecursiveIteratorIterator

public RecursiveIteratorIterator(Env env,
                                 ObjectValue iter,
                                 int mode,
                                 int flags)
Parameters:
iter - a RecursiveIterator
mode -
LEAVES_ONLY
(default) only iterate leaves
SELF_FIRST
iterate parents prior to children
CHILD_FIRST
iterate children prior to parents
flags -
CATCH_GET_CHILD
ignore exceptions in getChildren() call
Method Detail

beginChildren

public void beginChildren()
Template method provided for overriding classes, called right after getChildren() and rewind() on the child, default implemenation does nothing.


beginIteration

public void beginIteration()
Template method provided for overriding classes, default implementation does nothing.


callGetChildren

public Value callGetChildren()
Returns current iterator's children.


callHasChildren

public boolean callHasChildren()
Returns true if current iterator children.


current

public Value current()
Description copied from interface: Iterator
Returns the current value.

Specified by:
current in interface Iterator

endChildren

public void endChildren()
Template method provided for overriding classes, called after an iteterator has been used up.


endIteration

public void endIteration()
Template method provided for overriding classe, default implementation does nothing.


getDepth

public int getDepth()
Returns the current depth.


getInnerIterator

public ObjectValue getInnerIterator()
Specified by:
getInnerIterator in interface OuterIterator

getMaxDepth

public int getMaxDepth()
Returns the maximum depth.


getSubIterator

public Value getSubIterator(int depth)
Returns the iterator at the given depth

Parameters:
depth - the depth, default is current depth

key

public Value key()
Description copied from interface: Iterator
Returns the current key.

Specified by:
key in interface Iterator

next

public void next()
Description copied from interface: Iterator
Advances to the next row.

Specified by:
next in interface Iterator

nextElement

public void nextElement()
Template method provided for overriding classes, called when the next element is available


rewind

public void rewind()
Rewind to the first iterator, calling endChildren() along the way as appropriate.

Specified by:
rewind in interface Iterator

setMaxDepth

public void setMaxDepth(int maxDepth)
Sets the maximum depth.


valid

public boolean valid()
Return true if the iterator is valid.

Specified by:
valid in interface Iterator