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

Class SequenceCommandCreator<E>

  extended by dk.rode.thesis.factorymethod.CommandCreator<E,Sequence.State>
      extended by dk.rode.thesis.factorymethod.SequenceCommandCreator<E>
Type Parameters:
E - The type of values delivered by created commands (and thus sequences).
Direct Known Subclasses:
EvilSequenceCommandCreator, ReversibleSequenceCommandCreator

public class SequenceCommandCreator<E>
extends CommandCreator<E,Sequence.State>

A standard command creator creates new commands based on sequence states as tokens.

This creator can create the following commands based on the supplied internal sequence state:

A sequence command creator is stateless and thread-safe.

Gunni Rode / rode.dk

Constructor Summary
          No-arg constructor.
Method Summary
protected  Command<E> create(Sequence<E> sequence, Sequence.State state)
          Factory method to create a new command of the type specified by the token supplied as token.
Methods inherited from class dk.rode.thesis.factorymethod.CommandCreator
createDefault, equals, getCommand, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail


public SequenceCommandCreator()
No-arg constructor.

Method Detail


protected Command<E> create(Sequence<E> sequence,
                            Sequence.State state)
                     throws Exception
Description copied from class: CommandCreator
Factory method to create a new command of the type specified by the token supplied as token.

The sequence set as the receiver is supplied as sequence.

Specified by:
create in class CommandCreator<E,Sequence.State>
sequence - The sequence; never null.
state - The token identifying the type of command to create; can be null.
The corresponding command, or null if no such command could be created. If null is returned, a default (on null) command is returned by CommandCreator.getCommand(Sequence, Object).
Exception - If the creation fails; if so, a default (or null) command will be returned by getCommand.
See Also:

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.