edu.jhu.tmaj.util
Enum ObjectPool.WaitTime

java.lang.Object
  extended by java.lang.Enum<ObjectPool.WaitTime>
      extended by edu.jhu.tmaj.util.ObjectPool.WaitTime
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ObjectPool.WaitTime>
Enclosing class:
ObjectPool

public static enum ObjectPool.WaitTime
extends java.lang.Enum<ObjectPool.WaitTime>


Enum Constant Summary
DO_NOT_WAIT
           
WAIT_FIVE_SECONDS
           
WAIT_FOREVER
           
WAIT_HALF_SECOND
           
WAIT_ONE_SECOND
           
WAIT_QUARTER_SECOND
           
WAIT_TEN_SECONDS
           
WAIT_TWO_SECONDS
           
 
Method Summary
 long getObjectWaitTime(long startTime)
          Gets the wait time to put into the object.wait(...) method.
 boolean isTooLate(long startTime)
           
 boolean isWaitingAnOption()
           
static ObjectPool.WaitTime valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ObjectPool.WaitTime[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DO_NOT_WAIT

public static final ObjectPool.WaitTime DO_NOT_WAIT

WAIT_FOREVER

public static final ObjectPool.WaitTime WAIT_FOREVER

WAIT_QUARTER_SECOND

public static final ObjectPool.WaitTime WAIT_QUARTER_SECOND

WAIT_HALF_SECOND

public static final ObjectPool.WaitTime WAIT_HALF_SECOND

WAIT_ONE_SECOND

public static final ObjectPool.WaitTime WAIT_ONE_SECOND

WAIT_TWO_SECONDS

public static final ObjectPool.WaitTime WAIT_TWO_SECONDS

WAIT_FIVE_SECONDS

public static final ObjectPool.WaitTime WAIT_FIVE_SECONDS

WAIT_TEN_SECONDS

public static final ObjectPool.WaitTime WAIT_TEN_SECONDS
Method Detail

values

public static ObjectPool.WaitTime[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ObjectPool.WaitTime c : ObjectPool.WaitTime.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ObjectPool.WaitTime valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isTooLate

public boolean isTooLate(long startTime)

getObjectWaitTime

public long getObjectWaitTime(long startTime)
Gets the wait time to put into the object.wait(...) method. If we return 0, it means wait forever.


isWaitingAnOption

public boolean isWaitingAnOption()