Package org.eclipse.m2m.atl.emftvm.util

# Class LazyCollection.FilterIterator

java.lang.Object
org.eclipse.m2m.atl.emftvm.util.LazyCollection.ReadOnlyIterator<E>
LazyCollection<E>.org.eclipse.m2m.atl.emftvm.util.LazyCollection.CachingIterator
org.eclipse.m2m.atl.emftvm.util.LazyCollection.FilterIterator

All Implemented Interfaces:
  `Iterator<E>`

Direct Known Subclasses:
  `LazyCollection.RejectIterator`, `LazyCollection.SelectIterator`

Enclosing class:
  `LazyCollection<E>`

public abstract class LazyCollection.FilterIterator extends LazyCollection<E>.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 final CodeBlock`
`condition`
`protected E`
`next`
`protected boolean`
`nextIncluded`
`protected boolean`
`nextSet`
`protected final 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 a `LazyCollection<E>.FilterIterator` with `condition`.

## Method Summary

Modifier and Type
Method
Description
`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 Details

### condition

protected final CodeBlock condition

### parentFrame

protected final StackFrame parentFrame

### next

protected E next

### nextSet

protected boolean nextSet

### nextIncluded

protected boolean nextIncluded

## Constructor Details

### FilterIterator

public FilterIterator(CodeBlock condition, StackFrame parentFrame)
Creates a `LazyCollection<E>.FilterIterator` with `condition`.

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

## Method Details

### 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 `Iterator<E>`
Overrides:
  `hasNext` in class `LazyCollection<E>.CachingIterator`

### next

public E next()

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