Package org.eclipse.m2m.atl.emftvm.util
Class LazyCollection.FilterIterator
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.util.LazyCollection.ReadOnlyIterator<E>
-
- org.eclipse.m2m.atl.emftvm.util.LazyCollection.CachingIterator
-
- org.eclipse.m2m.atl.emftvm.util.LazyCollection.FilterIterator
-
- All Implemented Interfaces:
java.util.Iterator<E>
- Direct Known Subclasses:
LazyCollection.RejectIterator,LazyCollection.SelectIterator
- Enclosing class:
- LazyCollection<E>
public abstract class LazyCollection.FilterIterator extends LazyCollection.CachingIterator
LazyCollection.ReadOnlyIteratorthat filters elements from the underlying collection by evaluating a condition function on them.
-
-
Field Summary
Fields Modifier and Type Field Description protected CodeBlockconditionprotected Enextprotected booleannextIncludedprotected booleannextSetprotected StackFrameparentFrame-
Fields inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection.CachingIterator
i, inner
-
-
Constructor Summary
Constructors Constructor Description FilterIterator(CodeBlock condition, StackFrame parentFrame)Creates aLazyCollection.FilterIteratorwithcondition.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanhasNext()protected abstract booleaninclude(E element)Checks whether to includeEnext()-
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
-
-
-
-
Field Detail
-
condition
protected final CodeBlock condition
-
parentFrame
protected final StackFrame parentFrame
-
next
protected E next
-
nextSet
protected boolean nextSet
-
nextIncluded
protected boolean nextIncluded
-
-
Constructor Detail
-
FilterIterator
public FilterIterator(CodeBlock condition, StackFrame parentFrame)
Creates aLazyCollection.FilterIteratorwithcondition.- Parameters:
condition- the condition functionparentFrame- the parent stack frame context
-
-
Method Detail
-
include
protected abstract boolean include(E element)
Checks whether to includeelement
.- Parameters:
element- the element to filter- Returns:
trueiffelementshould be included in this collection
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<E>- Overrides:
hasNextin classLazyCollection.CachingIterator
-
next
public E next()
- Specified by:
nextin interfacejava.util.Iterator<E>- Overrides:
nextin classLazyCollection.CachingIterator
-
-