Class WrapperIterator

  • All Implemented Interfaces:
    java.util.Iterator

    public abstract class WrapperIterator
    extends java.lang.Object
    implements java.util.Iterator
    This implementation does not yet support removes once hasNext() has been called... will add if necessary.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Object SKIP_TOKEN  
    • Constructor Summary

      Constructors 
      Constructor Description
      WrapperIterator​(java.util.Iterator inner)  
      WrapperIterator​(java.util.Iterator inner, boolean supports_remove)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      java.lang.Object next()  
      void remove()  
      protected abstract java.lang.Object transformObject​(java.lang.Object o)
      return SKIP_TOKEN to indicate an object should be skipped, i.e., not exposed as part of the iterator.
      • Methods inherited from class java.lang.Object

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

        forEachRemaining
    • Field Detail

      • SKIP_TOKEN

        protected static final java.lang.Object SKIP_TOKEN
    • Constructor Detail

      • WrapperIterator

        public WrapperIterator​(java.util.Iterator inner,
                               boolean supports_remove)
      • WrapperIterator

        public WrapperIterator​(java.util.Iterator inner)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator
      • next

        public java.lang.Object next()
        Specified by:
        next in interface java.util.Iterator
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator
      • transformObject

        protected abstract java.lang.Object transformObject​(java.lang.Object o)
        return SKIP_TOKEN to indicate an object should be skipped, i.e., not exposed as part of the iterator. (we don't use null, because we want to support iterators over null-accepting Collections.)