org.ogf.saga.stream
Enum Activity

java.lang.Object
  extended by java.lang.Enum<Activity>
      extended by org.ogf.saga.stream.Activity
All Implemented Interfaces:
Serializable, Comparable<Activity>

public enum Activity
extends Enum<Activity>

Flags for activities of a stream. An application can poll for these events or get asynchronous notification of these events by using metrics. These flags are meant to be or-ed together, resulting in an integer, so methods are added to test for presence and or-ing.


Enum Constant Summary
EXCEPTION
          An error occured on the stream.
READ
          Data are available on the stream.
WRITE
          The stream is accepting data.
 
Method Summary
 int getValue()
          Returns the integer value of this enumeration literal.
 boolean isSet(int val)
          Tests for the presence of this flag in the specified value.
 int or(Activity val)
          Returns the result of or-ing this flag into another.
 int or(int val)
          Returns the result of or-ing this flag into an integer.
static Activity valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Activity[] 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

READ

public static final Activity READ
Data are available on the stream.


WRITE

public static final Activity WRITE
The stream is accepting data.


EXCEPTION

public static final Activity EXCEPTION
An error occured on the stream.

Method Detail

values

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

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

valueOf

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

getValue

public int getValue()
Returns the integer value of this enumeration literal.

Returns:
the integer value.

or

public int or(int val)
Returns the result of or-ing this flag into an integer.

Parameters:
val - the value to OR this enumeration value into.
Returns:
the result of or-ing this flag into the integer parameter.

or

public int or(Activity val)
Returns the result of or-ing this flag into another.

Parameters:
val - the value to OR this enumeration value into.
Returns:
the result of or-ing this flag into the integer parameter.

isSet

public boolean isSet(int val)
Tests for the presence of this flag in the specified value.

Parameters:
val - the value.
Returns:
true if this flag is present.


Copyright © 2014 Open Grid Forum. All rights reserved.