jmce - 1_02

jmce.util
Class Timeout

java.lang.Object
  extended by jmce.util.Timeout

public class Timeout
extends java.lang.Object

Timeout manager.

This class implements software timeout. Track time using the current system milliseconds / nanoseconds timer.

Version:
1.01
Author:
Mario Viara

Constructor Summary
Timeout()
          Default constructor.
Timeout(boolean nano)
          Constructor with specified unit
Timeout(long n)
          Constructor with specified timeout in ms
Timeout(long timeout, boolean nano)
          Constructor with specified timeout and unit of mesaures.
 
Method Summary
 int getElapsed()
          Return the number time as int.
 long getElapsedEx()
          Return the elapsed time as long
 boolean isExpired()
          Return true if the timer is expired.
static void main(java.lang.String[] argv)
          Main method for simple test
 void restart()
          Restart the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timeout

public Timeout()
Default constructor.


Timeout

public Timeout(long n)
Constructor with specified timeout in ms


Timeout

public Timeout(boolean nano)
Constructor with specified unit

Since:
1.01

Timeout

public Timeout(long timeout,
               boolean nano)
Constructor with specified timeout and unit of mesaures.

Parameters:
timeout - - The specified timeout
nano - - If true the unit of measures will be nano seconds else milliseconds.
Method Detail

restart

public final void restart()
Restart the timer.


getElapsedEx

public final long getElapsedEx()
Return the elapsed time as long

Since:
1.01

getElapsed

public final int getElapsed()
Return the number time as int.


isExpired

public final boolean isExpired()
Return true if the timer is expired.


main

public static void main(java.lang.String[] argv)
Main method for simple test


jmce - 1_02