net.sf.mmm.util.collection.base
Class FilteredIterable<E>

java.lang.Object
  extended by net.sf.mmm.util.collection.base.FilteredIterable<E>
Type Parameters:
E - is the generic type of the iterated elements.
All Implemented Interfaces:
Iterable<E>

public class FilteredIterable<E>
extends Object
implements Iterable<E>

This is an implementation of an Iterator that adapts another Iterator but only iterates the elements that are accepted by a given Filter.
ATTENTION:
This implementation is using FilteredIterator. Please read according javadoc first.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Iterable<E> delegate
          The actual Iterable instance to adapt.
private  Filter<E> filter
           
 
Constructor Summary
FilteredIterable(Iterable<E> delegate, Filter<E> filter)
          The constructor.
 
Method Summary
 Iterator<E> iterator()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

private final Iterable<E> delegate
The actual Iterable instance to adapt.


filter

private final Filter<E> filter
See Also:
iterator()
Constructor Detail

FilteredIterable

public FilteredIterable(Iterable<E> delegate,
                        Filter<E> filter)
The constructor.

Parameters:
delegate - is the Iterable to adapt.
filter - is the Filter that filters the iterated elements.
Method Detail

iterator

public Iterator<E> iterator()

Specified by:
iterator in interface Iterable<E>


Copyright © 2001-2010 mmm-Team. All Rights Reserved.