Package org.eclipse.m2m.atl.emftvm.util
Class LazyCollection.FilterIterator
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
LazyCollection.RejectIterator
,LazyCollection.SelectIterator
- Enclosing class:
- LazyCollection<E>
LazyCollection.ReadOnlyIterator
that filters elements from the underlying
collection by evaluating a condition function on them.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CodeBlock
protected E
protected boolean
protected boolean
protected final StackFrame
Fields inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection.CachingIterator
i, inner
-
Constructor Summary
ConstructorsConstructorDescriptionFilterIterator
(CodeBlock condition, StackFrame parentFrame) Creates aLazyCollection<E>.FilterIterator
withcondition
. -
Method Summary
Methods inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection.CachingIterator
updateCache
Methods inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection.ReadOnlyIterator
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
-
Field Details
-
condition
-
parentFrame
-
next
-
nextSet
protected boolean nextSet -
nextIncluded
protected boolean nextIncluded
-
-
Constructor Details
-
FilterIterator
Creates aLazyCollection<E>.FilterIterator
withcondition
.- Parameters:
condition
- the condition functionparentFrame
- the parent stack frame context
-
-
Method Details
-
include
Checks whether to includeelement
.- Parameters:
element
- the element to filter- Returns:
true
iffelement
should be included in this collection
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<E>
- Overrides:
hasNext
in classLazyCollection<E>.CachingIterator
-
next
- Specified by:
next
in interfaceIterator<E>
- Overrides:
next
in classLazyCollection<E>.CachingIterator
-