Class SequencedSupplier<S,​T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Iterable<T>, java.util.function.Supplier<T>, AutoFunctional, AutoSupplier<T>

    final class SequencedSupplier<S,​T>
    extends java.lang.Object
    implements AutoSupplier<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Supplier<T> myCurrent  
      private java.util.function.Function<S,​? extends java.util.function.Supplier<T>> myFactory  
      private java.util.concurrent.BlockingQueue<S> mySources  
    • Constructor Summary

      Constructors 
      Constructor Description
      SequencedSupplier​(java.util.concurrent.BlockingQueue<S> sources, java.util.function.Function<S,​? extends java.util.function.Supplier<T>> factory)  
    • Field Detail

      • myCurrent

        private java.util.function.Supplier<T> myCurrent
      • myFactory

        private final java.util.function.Function<S,​? extends java.util.function.Supplier<T>> myFactory
      • mySources

        private final java.util.concurrent.BlockingQueue<S> mySources
    • Constructor Detail

      • SequencedSupplier

        SequencedSupplier​(java.util.concurrent.BlockingQueue<S> sources,
                          java.util.function.Function<S,​? extends java.util.function.Supplier<T>> factory)
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface AutoSupplier<S>
        Throws:
        java.lang.Exception
      • nextSupplier

        private void nextSupplier()