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

dk.rode.thesis.state
Interface FunctionalState<E>

Type Parameters:
E - The type of values delivered by applicable stateable sequences.
All Known Implementing Classes:
ReversiblePrimeSequence.PrimeState

@Participant(value="State")
public interface FunctionalState<E>

A functional state encapsulates specific state related functionality of a stateable sequence.

Transitions between functional states are based on requests using internal states via the action(Sequence.State, StateableSequence) method.

Author:
Gunni Rode / rode.dk

Method Summary
 E action(Sequence.State internalState, StateableSequence<E> sequence)
          Depending on the value of the internal state supplied as internalState, the following forms of actions are inferred: Sequence.State.START: initialisation requested.
 

Method Detail

action

E action(Sequence.State internalState,
         StateableSequence<E> sequence)
Depending on the value of the internal state supplied as internalState, the following forms of actions are inferred:

Parameters:
internalState - The internal state representing the requested action; can be null (current).
sequence - The stateable sequence in question; cannot be null.
Returns:
The sequence result from the action taken; can be null.
Throws:
NullPointerException - If sequence is null.

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.