bcds.phison
Enum SimEvents

java.lang.Object
  extended by java.lang.Enum<SimEvents>
      extended by bcds.phison.SimEvents
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SimEvents>

public enum SimEvents
extends java.lang.Enum<SimEvents>

This enum class defines the events handled by the simulator.

Each enum has, in addition to its full (Java) name, an "external" short name (a.k.a. signature), so that CONN_REQUEST is the character 'c', for example.

Author:
Juan Segovia S.

Enum Constant Summary
CONN_RELEASE
          Connection release (short name is "r").
CONN_REQUEST
          Connection request (short name is "c").
LINK_FAILURE
          Link failure (short name is "fl").
LINK_REPAIR
          Link repair (short name is "flr").
NODE_FAILURE
          Node failure (short name is "fn").
NODE_REPAIR
          Node repair (short name is "fnr").
TIMED_CALL
          A schedule function activation.
 
Method Summary
static SimEvents getEnum(java.lang.String sig)
          Returns the enum object that corresponds to a given short name (sig), or null if sig does not correspond to any enum.
 java.lang.String getSignature()
          Returns the enum's short name.
 java.lang.String toString()
          Returns the enum name (Java) in lowercase.
static SimEvents valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SimEvents[] 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

CONN_REQUEST

public static final SimEvents CONN_REQUEST
Connection request (short name is "c").


CONN_RELEASE

public static final SimEvents CONN_RELEASE
Connection release (short name is "r"). Note that is possible to request a release of a connection that might not exist anymore, either because it was never created (there was no resources available at the connection request time) or because a failure happened that forced its removal.


LINK_FAILURE

public static final SimEvents LINK_FAILURE
Link failure (short name is "fl").


LINK_REPAIR

public static final SimEvents LINK_REPAIR
Link repair (short name is "flr"). It is meant to revert a previous link failure event.


NODE_FAILURE

public static final SimEvents NODE_FAILURE
Node failure (short name is "fn").


NODE_REPAIR

public static final SimEvents NODE_REPAIR
Node repair (short name is "fnr"). It is meant to revert a previous node failure event.


TIMED_CALL

public static final SimEvents TIMED_CALL
A schedule function activation. This is an internal event that may never appear in a "traffic" file.

Method Detail

values

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

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

valueOf

public static SimEvents 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

toString

public java.lang.String toString()
Returns the enum name (Java) in lowercase.

Overrides:
toString in class java.lang.Enum<SimEvents>

getEnum

public static SimEvents getEnum(java.lang.String sig)
Returns the enum object that corresponds to a given short name (sig), or null if sig does not correspond to any enum.

This method is needed because clients (such as TrafficReader) use short names which is not the same as the enum name ("c" vs CONN_REQUEST). Otherwise, we could have just used Enum.valueOf().


getSignature

public java.lang.String getSignature()
Returns the enum's short name.