|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> org.eclipse.emf.common.util.BasicEList<java.util.Iterator<? extends E>> org.eclipse.emf.common.util.AbstractTreeIterator<E>
public abstract class AbstractTreeIterator<E>
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/interfaces inherited from class org.eclipse.emf.common.util.BasicEList |
---|
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator<E1>, BasicEList.EListIterator<E1>, BasicEList.FastCompare<E>, BasicEList.NonResolvingEIterator<E1>, BasicEList.NonResolvingEListIterator<E1>, BasicEList.UnmodifiableEList<E> |
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 java.util.Iterator<? extends E> |
nextPruneIterator
The iterator that would be cut short by a call to prune() . |
protected java.util.Iterator<? extends E> |
nextRemoveIterator
The iterator to which a remove() call will delegated. |
protected java.lang.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(E object)
Creates an instance that iterates over an object, it's children, their children, and so on. |
|
AbstractTreeIterator(java.lang.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 java.util.Iterator<? extends E> |
getChildren(java.lang.Object object)
Returns the iterator that yields the children of the object. |
boolean |
hasNext()
Returns whether there are more elements. |
E |
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 java.lang.Object object
protected java.util.Iterator<? extends E> nextPruneIterator
prune()
.
protected java.util.Iterator<? extends E> nextRemoveIterator
remove()
call will delegated.
Constructor Detail |
---|
public AbstractTreeIterator(E object)
object
- the root object of the tree.public AbstractTreeIterator(java.lang.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.
If includeRoot
is true
, the object
is expected
to be of the type E
.
Method Detail |
---|
protected abstract java.util.Iterator<? extends E> getChildren(java.lang.Object object)
object
- the object for which children are required.
public boolean hasNext()
hasNext
in interface java.util.Iterator<E>
public E next()
next
in interface java.util.Iterator<E>
public void remove()
next()
from the underlying tree;
it's an optional operation.
remove
in interface java.util.Iterator<E>
java.lang.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<E>
|
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 |