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 TypeMethodDescriptionvoidCheck for exceeded time, test if time has exceeded and throw an exception if so.booleanisActive()isActive.voidrestart()Restart timer, set run-time to current time.voidsetAllow, set run-time interruption to allowed status.voidsetCallBack(Callable<Boolean> cb) set call back, set the Callabe object.voidsetLimit(long t) setLimit, set run-time limit in milliseconds.voidsetNotActive, 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
-
-
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
-
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
-
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.
-