Class Worker<TI,​TO>

  • All Implemented Interfaces:
    java.util.concurrent.Callable<Result<TO>>
    Direct Known Subclasses:
    WorkerVcf, WorkerVcfStr

    public class Worker<TI,​TO>
    extends ConcurrentActor
    implements java.util.concurrent.Callable<Result<TO>>
    Worker: Performs a simple work and get the data back TI: Data type in (input for this calculation) TO: Data type out (result form the calculation)
    Author:
    pablocingolani
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int id  
      protected java.lang.Object message  
    • Constructor Summary

      Constructors 
      Constructor Description
      Worker()  
    • Field Detail

      • id

        protected int id
      • message

        protected java.lang.Object message
    • Constructor Detail

      • Worker

        public Worker()
    • Method Detail

      • getId

        public static int getId()
      • calculate

        public TO calculate​(TI data)
        Perform main calculation You must override this method to perform whatever calculation you want to implement
      • calculate

        public Result<TO> calculate​(Work<TI> work)
        Perform some useful action
      • call

        public Result<TO> call()
        Specified by:
        call in interface java.util.concurrent.Callable<TI>
      • setMessage

        public void setMessage​(java.lang.Object pMessage)