|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdk.rode.thesis.factorymethod.CommandCreator<E,Sequence.State>
dk.rode.thesis.factorymethod.SequenceCommandCreator<E>
E - The type of values delivered by created commands (and thus sequences).@Participant(value="ConcreteCreator") public class SequenceCommandCreator<E>
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:
NullCommand is returned.
Sequence.State.NORMAL:
creates a new NextCommand instance.
Sequence.State.RESET:
creates a new ResetCommand instance.
CommandCreator.createDefault(Sequence)
is returned, if not null; if null, a null command is returned.
| Constructor Summary | |
|---|---|
SequenceCommandCreator()
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()
| Method Detail |
|---|
protected Command<E> create(Sequence<E> sequence,
Sequence.State state)
throws Exception
CommandCreatorcommand of the
type specified by the token supplied as token.
The sequence set as the receiver is supplied
as sequence.
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.
CommandCreator.getCommand(Sequence, Object).
Exception - If the creation fails; if so, a default (or null)
command will be returned by getCommand.CommandCreator.createDefault(Sequence)
|
Gunni Rode / rode.dk | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||