public static class EcoreUtil.ContentTreeIterator<E> extends AbstractTreeIterator<E>
Modifier and Type | Class and Description |
---|---|
protected static class |
EcoreUtil.ContentTreeIterator.ResourcesIterator
A special iterator that's tolerant of growth in the list of resources
which can result from demand loading when traversing the tree of contents.
|
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator<E1>, BasicEList.EListIterator<E1>, BasicEList.FastCompare<E>, BasicEList.NonResolvingEIterator<E1>, BasicEList.NonResolvingEListIterator<E1>, BasicEList.UnmodifiableEList<E>
Modifier and Type | Field and Description |
---|---|
protected boolean |
isResolveProxies
Whether proxies should be resolved.
|
protected EcoreUtil.ContentTreeIterator.ResourcesIterator |
resourceSetIterator
The most recently created iterator over a resource set's resources.
|
includeRoot, nextPruneIterator, nextRemoveIterator, object
data, size
Modifier | Constructor and Description |
---|---|
protected |
EcoreUtil.ContentTreeIterator(java.util.Collection<?> emfObjects)
Creates an instance for the given collection of objects.
|
protected |
EcoreUtil.ContentTreeIterator(java.lang.Object object,
boolean isResolveProxies)
Creates an instance for the given collection of objects.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<E> |
getChildren(java.lang.Object object)
Returns an iterator over the children of the given parent object.
|
protected java.util.Iterator<? extends EObject> |
getEObjectChildren(EObject eObject)
Returns an iterator over the
children of the given parent EObject. |
protected java.util.Iterator<E> |
getObjectChildren(java.lang.Object object)
Returns an empty iterator; subclasses may override this method.
|
protected java.util.Iterator<EObject> |
getResourceChildren(Resource resource)
Returns an iterator over the
children of the given parent resource. |
protected java.util.Iterator<Resource> |
getResourceSetChildren(ResourceSet resourceSet)
Returns an iterator over the
children of the given parent resource set. |
boolean |
hasNext()
Returns the next object and advances the iterator.
|
protected boolean |
isResolveProxies()
Returns whether proxies should resolve.
|
next, prune, remove
addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, assign, basicGet, basicList, clear, clone, contains, data, get, grow, indexOf, isEmpty, lastIndexOf, move, newData, primitiveGet, remove, setData, setUnique, shrink, size, toArray, toArray
add, add, addAll, addAll, basicIterator, basicListIterator, basicListIterator, canContainNull, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, isUnique, iterator, listIterator, listIterator, move, remove, removeAll, resolve, retainAll, set, toString, useEquals, validate
protected boolean isResolveProxies
protected EcoreUtil.ContentTreeIterator.ResourcesIterator resourceSetIterator
true
for hasNext()
even when the list is exhausted.
This ensures that any growth in the resources list will not be overlooked.protected EcoreUtil.ContentTreeIterator(java.util.Collection<?> emfObjects)
emfObjects
- the collection of objects to iterate over.protected EcoreUtil.ContentTreeIterator(java.lang.Object object, boolean isResolveProxies)
object
- the collection of objects to iterate over.isResolveProxies
- whether proxies should be resolved during the traversal.public java.util.Iterator<E> getChildren(java.lang.Object object)
getChildren
in class AbstractTreeIterator<E>
object
- the parent object.protected java.util.Iterator<? extends EObject> getEObjectChildren(EObject eObject)
children
of the given parent EObject.eObject
- the parent object.protected boolean isResolveProxies()
protected java.util.Iterator<EObject> getResourceChildren(Resource resource)
children
of the given parent resource.resource
- the parent resource.public boolean hasNext()
resourceSetIterator
in a special way,
i.e., it skips the null object that iterator yields as the last fake item of the list.hasNext
in interface java.util.Iterator<E>
hasNext
in class AbstractTreeIterator<E>
protected java.util.Iterator<Resource> getResourceSetChildren(ResourceSet resourceSet)
children
of the given parent resource set.
It also records the result in resourceSetIterator
for special handling in hasNext()
.resourceSet
- the parent resource set.protected java.util.Iterator<E> getObjectChildren(java.lang.Object object)
object
- the parent object.