javax.slee.facilities
Class TimerPreserveMissed

java.lang.Object
  |
  +--javax.slee.facilities.TimerPreserveMissed
All Implemented Interfaces:
java.io.Serializable

public final class TimerPreserveMissed
extends java.lang.Object
implements java.io.Serializable

This class defines an enumerated type for the late-timer preservation options suppored by the Timer Facility. A singleton instance of each enumerated value is guaranteed (via an implementation of readResolve() - refer java.io.Serializable), so that equality tests using == are always evaluated correctly. (This equality test is only guaranteed if this class is loaded in the application's boot class path, rather than dynamically loaded at runtime.)

The late-timer preservation options are:

See Also:
Serialized Form

Field Summary
static TimerPreserveMissed ALL
          Preserve-missed value for the ALL option.
static TimerPreserveMissed LAST
          Preserve-missed value for the LAST option.
static TimerPreserveMissed NONE
          Preserve-missed value for the NONE option.
static int PRESERVE_ALL
          An integer representation of ALL.
static int PRESERVE_LAST
          An integer representation of LAST.
static int PRESERVE_NONE
          An integer representation of NONE.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this preserve-missed option object for equality with another.
static TimerPreserveMissed fromInt(int option)
          Get a TimerPreserveMissed object from an integer value.
 int hashCode()
          Get a hash code value for this preserve-missed option object.
 boolean isAll()
          Determine if this TimerPreserveMissed object represents the ALL option.
 boolean isLast()
          Determine if this TimerPreserveMissed object represents the LAST option.
 boolean isNone()
          Determine if this TimerPreserveMissed object represents the NONE option.
 int toInt()
          Get an integer value representation for this TimerPreserveMissed object.
 java.lang.String toString()
          Get the textual representation of the TimerPreserveMissed object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRESERVE_NONE

public static final int PRESERVE_NONE
An integer representation of NONE.

PRESERVE_ALL

public static final int PRESERVE_ALL
An integer representation of ALL.

PRESERVE_LAST

public static final int PRESERVE_LAST
An integer representation of LAST.

NONE

public static final TimerPreserveMissed NONE
Preserve-missed value for the NONE option.

ALL

public static final TimerPreserveMissed ALL
Preserve-missed value for the ALL option.

LAST

public static final TimerPreserveMissed LAST
Preserve-missed value for the LAST option.
Method Detail

fromInt

public static TimerPreserveMissed fromInt(int option)
                                   throws java.lang.IllegalArgumentException
Get a TimerPreserveMissed object from an integer value.
Parameters:
option - the preserve-missed option as an integer.
Returns:
a TimerPreserveMissed object corresponding to the preserveMissed.
Throws:
java.lang.IllegalArgumentException - if option is not a valid preserve-missed option value.

toInt

public int toInt()
Get an integer value representation for this TimerPreserveMissed object.
Returns:
an integer value representation for this TimerPreserveMissed object.

isNone

public boolean isNone()
Determine if this TimerPreserveMissed object represents the NONE option.

This method is effectively equivalent to the conditional test: (this == NONE), ie. the code:

    if (timerPreserveMissed.isNone()) ...

is interchangeable with the code:

   if (timerPreserveMissed == TimerPreserveMissed.NONE) ...

Returns:
true if this object represents the NONE option, false otherwise.

isAll

public boolean isAll()
Determine if this TimerPreserveMissed object represents the ALL option.

This method is effectively equivalent to the conditional test: (this == ALL), ie. the code:

    if (timerPreserveMissed.isAll()) ...

is interchangeable with the code:

   if (timerPreserveMissed == TimerPreserveMissed.ALL) ...

Returns:
true if this object represents the ALL option, false otherwise.

isLast

public boolean isLast()
Determine if this TimerPreserveMissed object represents the LAST option.

This method is effectively equivalent to the conditional test: (this == LAST), ie. the code:

    if (timerPreserveMissed.isLast()) ...

is interchangeable with the code:

   if (timerPreserveMissed == TimerPreserveMissed.LAST) ...

Returns:
true if this object represents the LAST option, false otherwise.

equals

public boolean equals(java.lang.Object obj)
Compare this preserve-missed option object for equality with another.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class representing the same preserve-missed option as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this preserve-missed option object.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value.

toString

public java.lang.String toString()
Get the textual representation of the TimerPreserveMissed object.
Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the TimerPreserveMissed object.