DESY ACOP Beans Home

com.cosylab.util
Class TreeIterator<T,U>

java.lang.Object
  extended by com.cosylab.util.TreeIterator<T,U>
All Implemented Interfaces:
java.util.Iterator<T>

public abstract class TreeIterator<T,U>
extends java.lang.Object
implements java.util.Iterator<T>

Iterator for tree-like structures.

Author:
Klemen Zagar, Cosylab

Nested Class Summary
static class TreeIterator.Order
           
 
Constructor Summary
TreeIterator(U root, TreeIterator.Order order)
          Construct a tree iterator over a nested iterator structure.
 
Method Summary
protected abstract  java.util.Iterator<U> getChildren(U obj)
           
protected abstract  java.util.Iterator<T> getIterator(U obj)
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeIterator

public TreeIterator(U root,
                    TreeIterator.Order order)
Construct a tree iterator over a nested iterator structure.

Parameters:
root - Iterator through root-level elements.
order - Order of iteration over children.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
Specified by:
next in interface java.util.Iterator<T>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<T>

getChildren

protected abstract java.util.Iterator<U> getChildren(U obj)

getIterator

protected abstract java.util.Iterator<T> getIterator(U obj)


Copyright © 2010. All Rights Reserved.