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.ReadOnlyIterator
that filters elements from the underlying collection by evaluating a condition function on them.
-
-
Field Summary
Fields Modifier and Type Field Description protected CodeBlock
condition
protected E
next
protected boolean
nextIncluded
protected boolean
nextSet
protected StackFrame
parentFrame
-
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.FilterIterator
withcondition
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
protected abstract boolean
include(E element)
Checks whether to includeE
next()
-
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.FilterIterator
withcondition
.- 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:
true
iffelement
should be included in this collection
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<E>
- Overrides:
hasNext
in classLazyCollection.CachingIterator
-
next
public E next()
- Specified by:
next
in interfacejava.util.Iterator<E>
- Overrides:
next
in classLazyCollection.CachingIterator
-
-