|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.validation.service.AbstractTraversalStrategy org.eclipse.emf.validation.service.ITraversalStrategy.Recursive
public static final class ITraversalStrategy.Recursive
An implementation of the ITraversalStrategy
interface that is
recursive: it iterates over the content trees of the roots, according
to the basic EMF EObject.eAllContents()
tree-iterator. One bit
of value-add that it offers, though, is that it avoids duplication of
sub-trees where one of the traversal roots is actually contained within
another.
This traversal strategy assumes that only the root elements of the traversal may be in different client contexts, not any contents of their sub-trees.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.emf.validation.service.ITraversalStrategy |
---|
ITraversalStrategy.Flat, ITraversalStrategy.Recursive |
Constructor Summary | |
---|---|
ITraversalStrategy.Recursive()
Initializes me. |
Method Summary | |
---|---|
protected int |
countElements(Collection<? extends EObject> ignored)
Implemented by subclasses to compute the number of elements that will be validated within the scope of the specified root elements. |
protected Iterator<? extends EObject> |
createIterator(Collection<? extends EObject> ignored)
Implemented by subclasses to return an iterator that provides all of the elements to be validated, within the scope of the specified root elements. |
boolean |
isClientContextChanged()
This implementation is pessimistic, always returning true
to indicate that the client context should be recomputed for each
object traversed. |
void |
startTraversal(Collection<? extends EObject> traversalRoots,
IProgressMonitor progressMonitor)
Initializes the traversal by asking the subclass to count the number of elements that will be validated and to create an iterator that will provide them all. |
Methods inherited from class org.eclipse.emf.validation.service.AbstractTraversalStrategy |
---|
elementValidated, getProgressMonitor, getTaskLabel, hasNext, next |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ITraversalStrategy.Recursive()
Method Detail |
---|
public void startTraversal(Collection<? extends EObject> traversalRoots, IProgressMonitor progressMonitor)
AbstractTraversalStrategy
startTraversal
in interface ITraversalStrategy
startTraversal
in class AbstractTraversalStrategy
traversalRoots
- a collection of one or more EObject
s.
It is never empty, but neither is it modifiableprogressMonitor
- the progress monitor used to track progress. The receiver
may retain this progress monitor for the duration of the traversalprotected int countElements(Collection<? extends EObject> ignored)
AbstractTraversalStrategy
countElements
in class AbstractTraversalStrategy
ignored
- the roots of the traversal sub-trees
protected Iterator<? extends EObject> createIterator(Collection<? extends EObject> ignored)
AbstractTraversalStrategy
createIterator
in class AbstractTraversalStrategy
ignored
- the roots of the traversal sub-trees
public boolean isClientContextChanged()
AbstractTraversalStrategy
true
to indicate that the client context should be recomputed for each
object traversed.
isClientContextChanged
in interface ITraversalStrategy
isClientContextChanged
in class AbstractTraversalStrategy
true
if the next object to be returned by the
ITraversalStrategy.next()
method is potentially in a different client context
than the previous (thereby requiring the validation framework to
recompute the context); false
if the object can be
assumed to be in the same context as the previous
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |