edu.nrao.sss.util
Enum EventStatus

java.lang.Object
  extended by java.lang.Enum<EventStatus>
      extended by edu.nrao.sss.util.EventStatus
All Implemented Interfaces:
Serializable, Comparable<EventStatus>

public enum EventStatus
extends Enum<EventStatus>

An indicator for where an event is in its life cycle.

This status is meant for use by atomic events -- those that are not collections of other events. A related but distinct enumeration, EventSetStatus, is available for events that are collections of other events. For example, in the SSS Model, an "execution block" would be atomic and use this enumeration, while a a "scheduling block", which holds a collection of execution blocks, would use the EventSetStatus enumeration.

Version Info:

$Revision: 1042 $
$Date: 2008-01-14 09:37:55 -0700 (Mon, 14 Jan 2008) $
$Author: dharland $ (last person to modify)

Since:
2007-08-15
Author:
David M. Harland

Enum Constant Summary
CANCELED
          Indicates that an event has been canceled.
COMPLETED
          Indicates that an event has been completed.
IN_PROGRESS
          Indicates that an event is currently in progress.
NOT_READY_TO_BE_SCHEDULED
          Indicates that an event is not yet ready to be scheduled.
NOT_YET_SCHEDULED
          Indicates that an event has not yet been scheduled.
ON_HOLD
          Indicates that an event has been put on hold.
SCHEDULED_BUT_NOT_STARTED
          Indicates that an event has been scheduled but has not yet begun.
 
Method Summary
static EventStatus fromString(String text)
          Returns the status represented by text.
 boolean isFinal()
          Returns true if this status is a final status for an event.
 String toString()
          Returns a text representation of this enumeration constant.
 EnumSet<EventStatus> validNextStatuses()
          Returns a set of status that are permitted to follow this status.
static EventStatus valueOf(String name)
          Returns the enum constant of this type with the specified name.
static EventStatus[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOT_READY_TO_BE_SCHEDULED

public static final EventStatus NOT_READY_TO_BE_SCHEDULED
Indicates that an event is not yet ready to be scheduled. This is often the initial state for an event and usually means that the event is being crafted.


NOT_YET_SCHEDULED

public static final EventStatus NOT_YET_SCHEDULED
Indicates that an event has not yet been scheduled.


SCHEDULED_BUT_NOT_STARTED

public static final EventStatus SCHEDULED_BUT_NOT_STARTED
Indicates that an event has been scheduled but has not yet begun.


IN_PROGRESS

public static final EventStatus IN_PROGRESS
Indicates that an event is currently in progress.


COMPLETED

public static final EventStatus COMPLETED
Indicates that an event has been completed.


ON_HOLD

public static final EventStatus ON_HOLD
Indicates that an event has been put on hold. A event on hold can be resumed or restarted at a later time. An actor must act to take an event out of this status. Note that this is subtly different than postponing an event, which places its status immediately back to NOT_YET_SCHEDULED.


CANCELED

public static final EventStatus CANCELED
Indicates that an event has been canceled. A canceled event will not be resumed or restarted.

Method Detail

values

public static EventStatus[] 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 (EventStatus c : EventStatus.values())
    System.out.println(c);

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

valueOf

public static EventStatus valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isFinal

public boolean isFinal()
Returns true if this status is a final status for an event. CANCELED and COMPLETED are examples of final statuses.

Returns:
true if this status is a final status for an event.

validNextStatuses

public EnumSet<EventStatus> validNextStatuses()
Returns a set of status that are permitted to follow this status. For example, if an event has been scheduled, the only status that may immediately follow are "in progress" and "on hold"; if an event has been completed, there are no valid next statuses.

Returns:
a set of status that are permitted to follow this status.

toString

public String toString()
Returns a text representation of this enumeration constant.

Overrides:
toString in class Enum<EventStatus>
Returns:
a text representation of this enumeration constant.

fromString

public static EventStatus fromString(String text)
Returns the status represented by text.

For details about the transformation, see EnumerationUtility.enumFromString(Class, String).

Parameters:
text - a text representation of a status.
Returns:
the status represented by text.


Copyright © 2009. All Rights Reserved.