Package org.jetbrains.mps.util
Class TreeFilterIterator<T>
- java.lang.Object
-
- org.jetbrains.mps.util.TreeFilterIterator<T>
-
- All Implemented Interfaces:
Iterator<T>
public final class TreeFilterIterator<T> extends Object implements Iterator<T>
Iterator that uses condition to filter out complete sub-tree. For a tree:NodeA | o NodeB | | | o NodeC | o NodeD
and conditionendsWith("B")
, this iterator would yield {NodeA, NodeD}, i.e. completely throwing away NodeB and its sub-tree. Note, unlikeFilterIterator
, satisfied condition means element will be abandoned.
-
-
Constructor Summary
Constructors Constructor Description TreeFilterIterator(TreeIterator<T> iterator, Condition<T> skipCondition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
T
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-