org.hprog.code
Class InterpreterLimiter

java.lang.Object
  |
  +--org.hprog.code.InterpreterLimiter

public class InterpreterLimiter
extends java.lang.Object

Automatically interrupts an InteractiveInterpreter after a given time-out


Field Summary
static long LIMIT
          Default time limit, in milliseconds
 
Constructor Summary
InterpreterLimiter(InteractiveInterpreter i)
          Interrupts an interpreter after LIMIT milliseconds
InterpreterLimiter(InteractiveInterpreter i, long limit)
          Interrupts an interpreter after a specified time-out
 
Method Summary
 void cancel()
          Cancel this limiter, so that the target interpreter won't be interrupted after all
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIMIT

public static final long LIMIT
Default time limit, in milliseconds

See Also:
Constant Field Values
Constructor Detail

InterpreterLimiter

public InterpreterLimiter(InteractiveInterpreter i,
                          long limit)
Interrupts an interpreter after a specified time-out

Parameters:
i - interpreter to interrupt
limit - number of milliseconds to wait before interrupting

InterpreterLimiter

public InterpreterLimiter(InteractiveInterpreter i)
Interrupts an interpreter after LIMIT milliseconds

Method Detail

cancel

public void cancel()
Cancel this limiter, so that the target interpreter won't be interrupted after all