javax.realtime
Class Timed
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.InterruptedException
javax.realtime.AsynchronouslyInterruptedException
javax.realtime.Timed
- All Implemented Interfaces:
- Serializable
- public class Timed
- extends AsynchronouslyInterruptedException
Perform a computation (or subcomputation) that will be interrupted
after a specified duration.
- Since:
- 0.3.8
- Author:
- Morgan Deters
- See Also:
- Serialized Form
Method Summary |
boolean |
doInterruptible(Interruptible logic)
Start the timer, perform the computation (or subcomputation)
logic, and interrupt it (if it hasn't finished) when the timer
runs out. |
void |
resetTime(HighResolutionTime time)
Resets the timeout for the next timed computation. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Timed
public Timed(HighResolutionTime time)
- Constructs a new
Timed
.
- Parameters:
time
- the timeout for this Timed
instance
doInterruptible
public boolean doInterruptible(Interruptible logic)
- Start the timer, perform the computation (or subcomputation)
logic, and interrupt it (if it hasn't finished) when the timer
runs out.
- Overrides:
doInterruptible
in class AsynchronouslyInterruptedException
- Parameters:
logic
- the timed computation to perform
- Returns:
- true if the computation is interrupted; false if it
finishes normally
resetTime
public void resetTime(HighResolutionTime time)
- Resets the timeout for the next timed computation.
- Parameters:
time
- the new timeout for this Timed
instance
jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.