Class BoundedList.BoundedIterator

  • All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Iterator<T>
    Enclosing class:
    BoundedList<T>

    private class BoundedList.BoundedIterator
    extends java.lang.Object
    implements java.util.Iterator<T>, java.lang.Iterable<T>
    The actual iterator. We assume that an iterator instance will not be shared between threads and that elements will not be added to the list after the iterator is created.
    • Method Detail

      • hasNext

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

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • iterator

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object