- Christopher Mindus
Method SummaryModifier and TypeMethodDescription
booleanCancels the timeout task.
longGets the remaining time before timeout.
longGets the starting time.
booleanReturns whether timeout notification has been called or not.
booleanVerifies if timeout has occurred.
run()Called when timeout occurs.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStartTimepublic long getStartTime()Gets the starting time.
Returns the starting time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
See the description of the class
Datefor a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
getRemainingTimepublic long getRemainingTime()Gets the remaining time before timeout. This value just keeps on counting, even when the timeout has occurred or the task is stopped.
hasTimedOutpublic boolean hasTimedOut()Verifies if timeout has occurred.
hasNotifiedTimeoutpublic boolean hasNotifiedTimeout()Returns whether timeout notification has been called or not.
cancelTimeoutpublic boolean cancelTimeout()Cancels the timeout task. This call can be done from any thread and will stop any timeout notification of
runpublic void run()Called when timeout occurs.