Class TerrierTimer

  • All Implemented Interfaces:
    java.lang.Runnable

    public class TerrierTimer
    extends java.lang.Thread
    This class implements a timer.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double done
      Number of items in task completed
      protected short lastPercentage
      the last percentage that was output.
      protected java.lang.String message
      the message that should be output with the progress
      protected long startingTime
      The starting system time in millisecond.
      protected double total
      The total number of items to process in a task.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      TerrierTimer()  
      TerrierTimer​(java.lang.String message, double total)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String elapsed()
      Get a string summarising the processing/remaining time in minutes and seconds.
      void finished()  
      short getPercentage()  
      java.lang.String getRemainingTime()  
      void increment()  
      void increment​(double dIncrememt)  
      static java.lang.String longToText​(long timems)  
      void run()  
      void setDone​(double done)  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

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

      • startingTime

        protected final long startingTime
        The starting system time in millisecond.
      • total

        protected final double total
        The total number of items to process in a task.
      • done

        protected volatile double done
        Number of items in task completed
      • lastPercentage

        protected short lastPercentage
        the last percentage that was output. Set to a negative value, so that a value is always determined
      • message

        protected final java.lang.String message
        the message that should be output with the progress
    • Constructor Detail

      • TerrierTimer

        public TerrierTimer()
      • TerrierTimer

        public TerrierTimer​(java.lang.String message,
                            double total)
    • Method Detail

      • setDone

        public void setDone​(double done)
      • getPercentage

        public short getPercentage()
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • increment

        public void increment()
      • increment

        public void increment​(double dIncrememt)
      • finished

        public void finished()
      • getRemainingTime

        public java.lang.String getRemainingTime()
      • elapsed

        public java.lang.String elapsed()
        Get a string summarising the processing/remaining time in minutes and seconds.
      • longToText

        public static java.lang.String longToText​(long timems)