Class SCOCollectionIterator<E>

  • Type Parameters:
    E - Element type for the collection
    All Implemented Interfaces:
    java.util.Iterator<E>

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

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator<E> iter  
      private E last  
      private java.util.Collection<E> ownerSCO  
    • Constructor Summary

      Constructors 
      Constructor Description
      SCOCollectionIterator​(java.util.Collection<E> sco, DNStateManager sm, java.util.Collection<E> theDelegate, CollectionStore<E> backingStore, boolean useDelegate)
      Constructor taking the delegate or backing store.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      E next()  
      void remove()  
      • 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

      • iter

        private final java.util.Iterator<E> iter
      • last

        private E last
      • ownerSCO

        private java.util.Collection<E> ownerSCO
    • Constructor Detail

      • SCOCollectionIterator

        public SCOCollectionIterator​(java.util.Collection<E> sco,
                                     DNStateManager sm,
                                     java.util.Collection<E> theDelegate,
                                     CollectionStore<E> backingStore,
                                     boolean useDelegate)
        Constructor taking the delegate or backing store.
        Parameters:
        sco - The owner sco
        sm - StateManager of SCO Collection to iterate
        theDelegate - The delegate collection
        backingStore - The backing store (connected to the DB)
        useDelegate - Whether to use the delegate
    • Method Detail

      • hasNext

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

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

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