Class CsvTest.Worker<E>

  • Type Parameters:
    E - Result value of commands
    All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Runnable
    Enclosing class:
    CsvTest

    private static class CsvTest.Worker<E>
    extends java.lang.Object
    implements java.lang.Runnable, java.lang.AutoCloseable
    Receives commands on a queue and executes them on its own thread. Call close() to terminate.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Exception e
      Exception thrown by a command or queue wait.
      (package private) java.util.concurrent.Callable<E> end
      The poison pill command.
      (package private) java.util.concurrent.BlockingQueue<java.util.concurrent.Callable<E>> queue
      Queue of commands.
      private E v
      Value returned by the most recent command.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Worker()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void run()  
      • Methods inherited from class java.lang.Object

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

      • queue

        final java.util.concurrent.BlockingQueue<java.util.concurrent.Callable<E>> queue
        Queue of commands.
      • v

        private E v
        Value returned by the most recent command.
      • e

        private java.lang.Exception e
        Exception thrown by a command or queue wait.
      • end

        final java.util.concurrent.Callable<E> end
        The poison pill command.
    • Constructor Detail

      • Worker

        private Worker()
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable