Class OsCmdQueue

  • All Implemented Interfaces:
    java.lang.Iterable<OsCmdRunner>

    public class OsCmdQueue
    extends java.lang.Object
    implements java.lang.Iterable<OsCmdRunner>
    A queue of commands to be run. They are run in multiple threads (default number of threads = number of CPUs in the computer)
    Author:
    pcingola
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean debug  
    • Constructor Summary

      Constructors 
      Constructor Description
      OsCmdQueue()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(OsCmdRunner cmd)
      Add command to be executed
      void add​(OsCmdRunner cmd, java.lang.String outputFile)
      Add command to be executed, only if 'outputFile' does not exist
      java.util.Iterator<OsCmdRunner> iterator()  
      void kill()
      Kill all commands
      void run()
      Run commands
      void setNumThreads​(int numThreads)  
      void setRedirectToOutput​(boolean redirectToOutput)  
      void setVerbose​(boolean verbose)  
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • debug

        public static boolean debug
    • Constructor Detail

      • OsCmdQueue

        public OsCmdQueue()
    • Method Detail

      • add

        public void add​(OsCmdRunner cmd)
        Add command to be executed
        Parameters:
        cmd -
      • add

        public void add​(OsCmdRunner cmd,
                        java.lang.String outputFile)
        Add command to be executed, only if 'outputFile' does not exist
        Parameters:
        cmd -
        outputFile -
      • iterator

        public java.util.Iterator<OsCmdRunner> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<OsCmdRunner>
      • kill

        public void kill()
        Kill all commands
      • run

        public void run()
        Run commands
      • setNumThreads

        public void setNumThreads​(int numThreads)
      • setRedirectToOutput

        public void setRedirectToOutput​(boolean redirectToOutput)
      • setVerbose

        public void setVerbose​(boolean verbose)
      • size

        public int size()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object