Package edu.jas.kern

Class LocalTimeStatus


  • public class LocalTimeStatus
    extends java.lang.Object
    Run-time status, defines local status and handling for local run time limits.
    Author:
    Heinz Kredel
    See Also:
    TimeStatus
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LocalTimeStatus.TSCall
      A default call back class.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalTimeStatus()
      Public constructor.
      LocalTimeStatus​(boolean a, long d, boolean r)
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkTime​(java.lang.String msg)
      Check for exceeded time, test if time has exceeded and throw an exception if so.
      boolean isActive()
      isActive.
      void restart()
      Restart timer, set run-time to current time.
      void setActive()
      setAllow, set run-time interruption to allowed status.
      void setCallBack​(java.util.concurrent.Callable<java.lang.Boolean> cb)
      set call back, set the Callabe object.
      void setLimit​(long t)
      setLimit, set run-time limit in milliseconds.
      void setNotActive()
      setNotActive, set run-time interruption to not active status.
      java.lang.String toString()
      To String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LocalTimeStatus

        public LocalTimeStatus​(boolean a,
                               long d,
                               boolean r)
        Public constructor.
        Parameters:
        a - true for active, false for inactive
        d - time limit before exception
        r - true for continue, false for exception
    • Method Detail

      • toString

        public java.lang.String toString()
        To String.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this.
      • isActive

        public boolean isActive()
        isActive.
        Returns:
        true, if run-time interruption is active, else false.
      • setActive

        public void setActive()
        setAllow, set run-time interruption to allowed status.
      • setNotActive

        public void setNotActive()
        setNotActive, set run-time interruption to not active status.
      • setLimit

        public void setLimit​(long t)
        setLimit, set run-time limit in milliseconds.
      • restart

        public void restart()
        Restart timer, set run-time to current time.
      • setCallBack

        public void setCallBack​(java.util.concurrent.Callable<java.lang.Boolean> cb)
        set call back, set the Callabe object.
      • checkTime

        public void checkTime​(java.lang.String msg)
        Check for exceeded time, test if time has exceeded and throw an exception if so.
        Parameters:
        msg - the message to be send with the exception.