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.
| Methods inherited from class java.util.AbstractCollection |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
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.
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