|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
org.eclipse.emf.common.util.BasicEList
org.eclipse.emf.common.util.AbstractTreeIterator
An extensible tree iterator implementation
that iterates over an object, it's children, their children, and so on.
Clients need only implement getChildren
in order to implement a fully functional tree iterator.
Nested Class Summary |
Nested classes inherited from class org.eclipse.emf.common.util.BasicEList |
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator, BasicEList.EListIterator, BasicEList.FastCompare, BasicEList.NonResolvingEIterator, BasicEList.NonResolvingEListIterator, BasicEList.UnmodifiableEList |
Field Summary | |
protected boolean |
includeRoot
Whether the first call to next returns the initial root object or begins with the first child of the root object. |
protected Iterator |
nextPruneIterator
The iterator that would be cut short by a call to prune() . |
protected Iterator |
nextRemoveIterator
The iterator to which a remove() call will delegated. |
protected Object |
object
The root object for which the iteration is initiated. |
Fields inherited from class org.eclipse.emf.common.util.BasicEList |
data, size |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
AbstractTreeIterator(Object object)
Creates an instance that iterates over an object, it's children, their children, and so on. |
|
AbstractTreeIterator(Object object,
boolean includeRoot)
Creates and instance that iterates over an object (but only if includeRoot is true ),
it's children, their children, and so on. |
Method Summary | |
protected abstract Iterator |
getChildren(Object object)
Returns the iterator that yields the children of the object. |
boolean |
hasNext()
Returns whether there are more elements. |
Object |
next()
Returns the next object and advances the iterator. |
void |
prune()
Prunes the iterator so that it skips over all the nodes below the most recent result of calling next() . |
void |
remove()
Removes the last object returned by next() from the underlying tree;
it's an optional operation. |
Methods inherited from class org.eclipse.emf.common.util.BasicEList |
add, add, addAll, addAll, addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, assign, basicGet, basicIterator, basicList, basicListIterator, basicListIterator, canContainNull, clear, clone, contains, containsAll, data, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, get, getDuplicates, getNonDuplicates, grow, hashCode, indexOf, isEmpty, isUnique, iterator, lastIndexOf, listIterator, listIterator, move, move, newData, remove, remove, removeAll, resolve, retainAll, set, setData, setUnique, shrink, size, toArray, toArray, toString, useEquals, validate |
Methods inherited from class java.util.AbstractList |
removeRange, subList |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
subList |
Field Detail |
protected boolean includeRoot
protected Object object
protected Iterator nextPruneIterator
prune()
.
protected Iterator nextRemoveIterator
remove()
call will delegated.
Constructor Detail |
public AbstractTreeIterator(Object object)
object
- the root object of the tree.public AbstractTreeIterator(Object object, boolean includeRoot)
includeRoot
is true
),
it's children, their children, and so on.
Method Detail |
protected abstract Iterator getChildren(Object object)
object
- the object for which children are required.
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
public void remove()
next()
from the underlying tree;
it's an optional operation.
remove
in interface Iterator
IllegalStateException
- if next
has not yet been called or has been called only the yield the root object,
or remove
has already been called after the last call to the next
method.public void prune()
next()
.
prune
in interface TreeIterator
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |