net.sf.molae.pipe.tree
Class DepthFirstCollection

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--net.sf.molae.pipe.tree.DepthFirstCollection
All Implemented Interfaces:
Collection

public final class DepthFirstCollection
extends AbstractCollection

A collection based on the DepthFirstIterator.


Constructor Summary
DepthFirstCollection(Object base)
          Constructs a DepthFirstCollection.
DepthFirstCollection(Object base, CompositionView compositionView)
          Constructs a DepthFirstCollection.
 
Method Summary
 Iterator iterator()
           
 int size()
          Uses the iterator to count the elements.
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

DepthFirstCollection

public DepthFirstCollection(Object base,
                            CompositionView compositionView)
Constructs a DepthFirstCollection.
Parameters:
base - the root object of the tree - must not be an Iterator.
compositionView - the compositionView to be used

DepthFirstCollection

public DepthFirstCollection(Object base)
Constructs a DepthFirstCollection.
Parameters:
base - the root object of the tree - must not be an Iterator.
Method Detail

iterator

public Iterator iterator()
Overrides:
iterator in class AbstractCollection

size

public int size()
Uses the iterator to count the elements.
Overrides:
size in class AbstractCollection