Package edu.jas.kern
Class LocalTimeStatus
- java.lang.Object
-
- edu.jas.kern.LocalTimeStatus
-
public class LocalTimeStatus extends java.lang.Object
Run-time status, defines local status and handling for local run time limits.- See Also:
TimeStatus
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocalTimeStatus.TSCall
A default call back class.
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowTime
Local status flag.private java.util.concurrent.Callable<java.lang.Boolean>
callBack
Local call back method.private long
limitTime
Local run-time limit in milliseconds.private long
startTime
Local run-time limit in milliseconds.
-
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.
-
-
-
Field Detail
-
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 java.util.concurrent.Callable<java.lang.Boolean> callBack
Local call back method. true means continue, false means throw exception.
-
-
Method Detail
-
toString
public java.lang.String toString()
To String.- Overrides:
toString
in classjava.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.
-
-