Class AdapterIterator<T,​U>

  • All Implemented Interfaces:
    Iterator<T>

    public abstract class AdapterIterator<T,​U>
    extends Object
    implements Iterator<T>
    Iterator implementation that works as a filter to another iterator.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • AdapterIterator

        public AdapterIterator​(Iterator<? extends U> core)
    • Method Detail

      • next

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

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<T>
      • adapt

        protected abstract T adapt​(U u)
        Returns:
        null to filter out this object. Non-null object will be returned from the iterator to the caller.