ewe.sys
Class TimeOut

java.lang.Object
  extended byewe.sys.TimeOut

public class TimeOut
extends Object


Field Summary
 boolean expired
           
static TimeOut Forever
           
static TimeOut Immediate
           
static int Infinite
          This is the value for an infinite timeout in milliseconds, equal to -1.
protected  int interval
           
protected  int started
           
static int Zero
          This is the value for a zero timeout in milliseconds, equal to 0.
 
Constructor Summary
TimeOut(int time)
          Create a timeout with the specified number of milliseconds.
 
Method Summary
 int elapsed()
          How many milliseconds has elapsed since the TimeOut was started/reset.
 void expire()
          Force it to expire.
 TimeOut getNew()
          Get a copy of this TimeOut, i.e.
 boolean hasExpired()
          Has this TimeOut expired yet?
 void multiThreadedWait(Object obj)
           
static int now()
           
 int remaining()
          How many milliseconds remaining? If it returns -1 it means that it will never timeout.
 TimeOut reset()
           
 void wait(Object obj)
          This will block the current thread until the TimeOut expires.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

Infinite

public static final int Infinite
This is the value for an infinite timeout in milliseconds, equal to -1.

See Also:
Constant Field Values

Zero

public static final int Zero
This is the value for a zero timeout in milliseconds, equal to 0.

See Also:
Constant Field Values

started

protected int started

interval

protected int interval

expired

public boolean expired

Forever

public static TimeOut Forever

Immediate

public static TimeOut Immediate
Constructor Detail

TimeOut

public TimeOut(int time)
Create a timeout with the specified number of milliseconds.

Method Detail

now

public static int now()

reset

public TimeOut reset()

hasExpired

public boolean hasExpired()
Has this TimeOut expired yet?


remaining

public int remaining()
How many milliseconds remaining? If it returns -1 it means that it will never timeout.


elapsed

public int elapsed()
How many milliseconds has elapsed since the TimeOut was started/reset.


expire

public void expire()
Force it to expire.


getNew

public TimeOut getNew()
Get a copy of this TimeOut, i.e. one which has the same interval.


wait

public void wait(Object obj)
This will block the current thread until the TimeOut expires. It -MAY- block any other threads. For single threaded applications such as Waba, calling this method WILL block other threads (i.e. the entire application). If the underlying VM is multithreaded it should not block any OS threads.


multiThreadedWait

public void multiThreadedWait(Object obj)