Class FilteredIterable<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public class FilteredIterable<T>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    Wraps any Iterable and allows filtered retrieval of its content according to the filter provided.
    Example:

    List stringList;
    ...
    for(String s: new FilteredIterable(stringList, someFilter))
    {
    // iterating through all elements that passes filtration implemented in someFilter
    }
    Author:
    Sergey.Anchipolevsky Date: 20.08.2007
    • Constructor Summary

      Constructors 
      Constructor Description
      FilteredIterable​(java.lang.Iterable<T> delegate, Filter<? super T> filter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<T> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • FilteredIterable

        public FilteredIterable​(@NotNull
                                java.lang.Iterable<T> delegate,
                                @NotNull
                                Filter<? super T> filter)
    • Method Detail

      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>