Class LoopTool.SyncedIterator

  • Enclosing class:
    LoopTool

    public static class LoopTool.SyncedIterator
    extends java.lang.Object
    Simple wrapper to make it easy to keep an arbitray Iterator in sync with a LoopTool.ManagedIterator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object current  
      private java.util.Iterator iterator  
    • Constructor Summary

      Constructors 
      Constructor Description
      SyncedIterator​(java.util.Iterator iterator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get()
      Returns the currently parallel value, if any.
      void shift()
      If the sync'ed iterator has any more values, this sets the next() value as the current one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • iterator

        private java.util.Iterator iterator
      • current

        private java.lang.Object current
    • Constructor Detail

      • SyncedIterator

        public SyncedIterator​(java.util.Iterator iterator)
    • Method Detail

      • shift

        public void shift()
        If the sync'ed iterator has any more values, this sets the next() value as the current one. If there are no more values, this sets the current one to null.
      • get

        public java.lang.Object get()
        Returns the currently parallel value, if any.