Package edu.jas.kern
Class LocalTimeStatus
java.lang.Object
edu.jas.kern.LocalTimeStatus
Run-time status, defines local status and handling for local run time limits.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPublic constructor.LocalTimeStatus
(boolean a, long d, boolean r) Public constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
setAllow, set run-time interruption to allowed status.void
setCallBack
(Callable<Boolean> cb) set call back, set the Callabe object.void
setLimit
(long t) setLimit, set run-time limit in milliseconds.void
setNotActive, set run-time interruption to not active status.toString()
To String.
-
Field Details
-
allowTime
private boolean allowTimeLocal status flag. -
limitTime
private long limitTimeLocal run-time limit in milliseconds. -
startTime
private long startTimeLocal run-time limit in milliseconds. -
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 inactived
- time limit before exceptionr
- true for continue, false for exception
-
-
Method Details
-
toString
To String. -
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
set call back, set the Callabe object. -
checkTime
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.
-