Class Filter<T>

  • Type Parameters:
    T - the type to filter

    @NotThreadSafe
    public abstract class Filter<T>
    extends java.lang.Object
    This is an abstract filter that can be used to filter iterable list. This Filter class was copied from: http://erikras.com/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/ Erik Rasmussen - © 2006 - 2012 All Rights Reserved. @author Erik Rasmussen https://plus.google.com/115403795880834599019/?rel=author
    • Constructor Summary

      Constructors 
      Constructor Description
      Filter()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Iterable<T> filter​(java.lang.Iterable<T> iterable)
      Filters a given iterable.
      java.util.Iterator<T> filter​(java.util.Iterator<T> iterator)
      Filters a given iterator.
      abstract boolean passes​(T object)
      Determines whether the object passes the filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Filter

        public Filter()
    • Method Detail

      • passes

        public abstract boolean passes​(T object)
        Determines whether the object passes the filter.
        Parameters:
        object - the object to test
        Returns:
        whether or not the object passes the filter
      • filter

        public java.util.Iterator<T> filter​(java.util.Iterator<T> iterator)
        Filters a given iterator.
        Parameters:
        iterator - the iterator to filter
        Returns:
        the filtered iterator
      • filter

        public java.lang.Iterable<T> filter​(java.lang.Iterable<T> iterable)
        Filters a given iterable.
        Parameters:
        iterable - the iterable to filter
        Returns:
        the filtered iterable