Class SCOListIterator<E>

  • Type Parameters:
    E - Type of element in the List
    All Implemented Interfaces:
    java.util.Iterator<E>, java.util.ListIterator<E>

    public class SCOListIterator<E>
    extends java.lang.Object
    implements java.util.ListIterator<E>
    An iterator for a SCO List object. Operates from either a delegate or a backing store, and provides iteration through the objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ListIterator<E> iter  
      private java.util.List<E> ownerSCO
      The owning SCO that we are really iterating.
      private boolean reverse
      Whether the most recent access operation was a previous()
    • Constructor Summary

      Constructors 
      Constructor Description
      SCOListIterator​(java.util.List<E> sco, DNStateManager sm, java.util.List<E> theDelegate, ListStore<E> theStore, boolean useDelegate, int startIndex)
      Constructor taking the delegate or backing store, and any start index.
    • Field Detail

      • iter

        private final java.util.ListIterator<E> iter
      • ownerSCO

        private final java.util.List<E> ownerSCO
        The owning SCO that we are really iterating.
      • reverse

        private boolean reverse
        Whether the most recent access operation was a previous()
    • Constructor Detail

      • SCOListIterator

        public SCOListIterator​(java.util.List<E> sco,
                               DNStateManager sm,
                               java.util.List<E> theDelegate,
                               ListStore<E> theStore,
                               boolean useDelegate,
                               int startIndex)
        Constructor taking the delegate or backing store, and any start index.
        Parameters:
        sco - Owner SCO
        sm - StateManager of SCO List to iterate
        theDelegate - The delegate list
        theStore - The backing store (connected to the DB)
        useDelegate - whether to use a delegate
        startIndex - The start index position (any value below 0 will mean start at index 0).
    • Method Detail

      • add

        public void add​(E o)
        Specified by:
        add in interface java.util.ListIterator<E>
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<E>
        Specified by:
        hasNext in interface java.util.ListIterator<E>
      • hasPrevious

        public boolean hasPrevious()
        Specified by:
        hasPrevious in interface java.util.ListIterator<E>
      • next

        public E next()
        Specified by:
        next in interface java.util.Iterator<E>
        Specified by:
        next in interface java.util.ListIterator<E>
      • nextIndex

        public int nextIndex()
        Specified by:
        nextIndex in interface java.util.ListIterator<E>
      • previous

        public E previous()
        Specified by:
        previous in interface java.util.ListIterator<E>
      • previousIndex

        public int previousIndex()
        Specified by:
        previousIndex in interface java.util.ListIterator<E>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<E>
        Specified by:
        remove in interface java.util.ListIterator<E>
      • set

        public void set​(E o)
        Specified by:
        set in interface java.util.ListIterator<E>