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
`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
`FilterIterator​(CodeBlock condition, StackFrame parentFrame)` Creates a `LazyCollection.FilterIterator` with `condition`.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`boolean` `hasNext()`
`protected abstract boolean` `include​(E element)` Checks whether to include
`E` `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`

### 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 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 a `LazyCollection.FilterIterator` with `condition`.

Parameters:
  `condition` - the condition function
  `parentFrame` - the parent stack frame context

### Method Detail

#### include

    protected abstract boolean include​(E element)

Checks whether to include

    element

.

Parameters:
  `element` - the element to filter
Returns:
  `true` iff `element` should be included in this collection

#### hasNext

    public boolean hasNext()

Specified by:
  `hasNext` in interface `java.util.Iterator<E>`
Overrides:
  `hasNext` in class `LazyCollection.CachingIterator`

#### next

    public E next()

Specified by:
  `next` in interface `java.util.Iterator<E>`
Overrides:
  `next` in class `LazyCollection.CachingIterator`