Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

dk.rode.thesis.meta.model
Enum Sequence.State

java.lang.Object
  extended by java.lang.Enum<Sequence.State>
      extended by dk.rode.thesis.meta.model.Sequence.State
All Implemented Interfaces:
Serializable, Comparable<Sequence.State>
Enclosing interface:
Sequence<E>

public static enum Sequence.State
extends Enum<Sequence.State>

The possible internal states a Sequence can have.

Author:
Gunni Rode / rode.dk
See Also:
Sequence.state()

Enum Constant Summary
NORMAL
          Internal state of any sequence unless START, RESET, or RESTART applies to it.
RESET
          Internal state explicitly set using Sequence.reset().
RESTART
          A bounded and consistent sequence will have this internal state if it has restarted its sequence of values.
START
          Initial internal state: neither Sequence.next(), nor Sequence.reset() has been invoked yet.
 
Method Summary
static Sequence.State valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Sequence.State[] 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

NORMAL

public static final Sequence.State NORMAL
Internal state of any sequence unless START, RESET, or RESTART applies to it.


RESET

public static final Sequence.State RESET
Internal state explicitly set using Sequence.reset().


RESTART

public static final Sequence.State RESTART
A bounded and consistent sequence will have this internal state if it has restarted its sequence of values.


START

public static final Sequence.State START
Initial internal state: neither Sequence.next(), nor Sequence.reset() has been invoked yet.

However, a current value can still be obtained as sequences never return null values.

Method Detail

valueOf

public static Sequence.State 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

values

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

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

Gunni Rode / rode.dk

Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!

The original thesis and source code are available at rode.dk/thesis.