Class Filterator<E>

Type Parameters:
E - Element type
All Implemented Interfaces:

public class Filterator<E> extends Object implements Iterator<E>
Filtered iterator class: an iterator that includes only elements that are instanceof a specified class.

Apologies for the dorky name.

See Also:
  • Constructor Details

    • Filterator

      public Filterator(Iterator<?> iterator, Class<E> includeFilter)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<E>
    • next

      public E next()
      Specified by:
      next in interface Iterator<E>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<E>