Package edu.jas.kern

Class LocalTimeStatus

java.lang.Object
edu.jas.kern.LocalTimeStatus

public class LocalTimeStatus extends Object
Run-time status, defines local status and handling for local run time limits.
See Also:
  • Field Details

    • allowTime

      private boolean allowTime
      Local status flag.
    • limitTime

      private long limitTime
      Local run-time limit in milliseconds.
    • startTime

      private long startTime
      Local run-time limit in milliseconds.
    • callBack

      private Callable<Boolean> callBack
      Local call back method. true means continue, false means throw exception.
  • Constructor Details

    • LocalTimeStatus

      public LocalTimeStatus()
      Public constructor.
    • 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 Details

    • toString

      public String toString()
      To String.
      Overrides:
      toString in class 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(Callable<Boolean> cb)
      set call back, set the Callabe object.
    • checkTime

      public void checkTime(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.