Class SequenceIterator<T>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Removes all registered iterators.
      SequenceIterator<T> clone()
      Creates a copy of the iterator.
      boolean hasValue()
      Checks if the iterator is not exhausted (a value is available).
      void init()
      Initializes the iterator.
      Iterator<T> iterator​(int index)
      Returns the i-th iterator of the list.
      void next()
      Makes an iteration.
      void registerIterator​(Iterator<T> iterator)
      Registers the iterator.
      int size()
      Returns the number of the registered iterators.
      void stop()
      Stops the iterator.
      T value()
      Returns the current value of the iterator.
      • Methods inherited from class java.lang.Object

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

      • SequenceIterator

        public SequenceIterator()
        Constructs a sequence iterator.
      • SequenceIterator

        protected SequenceIterator​(SequenceIterator<T> other)
        Constructs a copy of the sequence iterator.
        Parameters:
        other - the iterator to be copied.
    • Method Detail

      • registerIterator

        public void registerIterator​(Iterator<T> iterator)
        Registers the iterator.
        Parameters:
        iterator - the iterator to be registered.
      • clear

        public void clear()
        Removes all registered iterators.
      • size

        public int size()
        Returns the number of the registered iterators.
        Returns:
        the number of the registered iterators.
      • iterator

        public Iterator<T> iterator​(int index)
        Returns the i-th iterator of the list.
        Parameters:
        index - the index of iterator in the list.
        Returns:
        the i-th iterator of the list.
      • init

        public void init()
        Description copied from interface: Iterator
        Initializes the iterator.
        Specified by:
        init in interface Iterator<T>
      • hasValue

        public boolean hasValue()
        Description copied from interface: Iterator
        Checks if the iterator is not exhausted (a value is available).
        Specified by:
        hasValue in interface Iterator<T>
        Returns:
        true if the iterator is not exhausted; false otherwise.
      • value

        public T value()
        Description copied from interface: Iterator
        Returns the current value of the iterator.
        Specified by:
        value in interface Iterator<T>
        Returns:
        the current value of the iterator.
      • next

        public void next()
        Description copied from interface: Iterator
        Makes an iteration.
        Specified by:
        next in interface Iterator<T>
      • stop

        public void stop()
        Description copied from interface: Iterator
        Stops the iterator.
        Specified by:
        stop in interface Iterator<T>
      • clone

        public SequenceIterator<T> clone()
        Description copied from interface: Iterator
        Creates a copy of the iterator.
        Specified by:
        clone in interface Iterator<T>
        Overrides:
        clone in class java.lang.Object
        Returns:
        A copy of the iterator.