|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Command | |
---|---|
dk.rode.thesis.command | Implementations and examples of the Command design pattern [Gamma95, p.233]. |
dk.rode.thesis.factorymethod | Implementations and examples of the Factory Method design pattern [Gamma95, p.107]. |
Uses of Command in dk.rode.thesis.command |
---|
Classes in dk.rode.thesis.command that implement Command | |
---|---|
class |
CompositeCommand<E>
A composite command is a command that represents an number of other contained commands, possibly composite as well, thus forming a tree-like structure. |
class |
EvilCommand<E>
An evil command is a test command that will always fail during execution and perhaps
on undo as well by specifying that it is
undoable while in reality it is not. |
class |
LogCommand<E>
A log command simply logs the operation performed on the receiver object. |
class |
NextCommand<E>
A next command command will invoke next() on its receiving sequence when it is
executed . |
class |
NullCommand<E>
A null command performs no operation on execute or on undo , is always considered
undoable , and carries no state. |
class |
ResetCommand<E>
A reset command command will invoke reset() on its receiving sequence when it is
executed . |
class |
ReverseCommand<E>
A reserve command command will reverse a given sequence when it is executed , if
possible. |
class |
SequenceCommand<E>
A sequence command is a command that manipulates the state of a sequence when it
is executed . |
Fields in dk.rode.thesis.command with type parameters of type Command | |
---|---|
private List<Command<E>> |
ReverseCommand.commands
Command instances to spawn in case the sequence is not reversible, if any. |
private List<Command<E>> |
CompositeCommand.commands
The commands associated with this command, in order. |
Methods in dk.rode.thesis.command with type parameters of type Command | ||
---|---|---|
|
CompositeCommand.getCommands(Class<V> type)
Returns the commands currently
associated with this composite command, in order,
assignable to the type supplied as type . |
Methods in dk.rode.thesis.command that return Command | |
---|---|
Command<E> |
Command.copy()
Creates a copy of this command, excluding internal state information required for execution and undo. |
Methods in dk.rode.thesis.command that return types with arguments of type Command | ||
---|---|---|
(package private) abstract
|
Creator.create(Sequence<E> sequence,
Boolean fail)
Returns a list of test commands primed with sequence
as the receiver. |
|
protected abstract List<Command<E>> |
SequenceCommand.doExecute(boolean saved)
Performs the actual execution of this command. |
|
protected List<Command<E>> |
ReverseCommand.doExecute(boolean saved)
Reverses the sequence if reversible and returns the current (same) value. |
|
protected List<Command<E>> |
ResetCommand.doExecute(boolean saved)
Resets the sequence value and sets the result to the (new) current value. |
|
protected List<Command<E>> |
NextCommand.doExecute(boolean saved)
Sets the result of the execution to the next
sequence value. |
|
List<Command<E>> |
SequenceCommand.execute()
Saves the before state of this sequence command if the receiver sequence is a memorizable
sequence before execution . |
|
List<Command<E>> |
NullCommand.execute()
Does nothing. |
|
List<Command<E>> |
LogCommand.execute()
Logs the string representation of the receiver object followed by " .execute() ". |
|
List<Command<E>> |
EvilCommand.execute()
Always throws EvilCommand.ERROR . |
|
List<Command<E>> |
CompositeCommand.execute()
|
|
List<Command<E>> |
Command.execute()
Performs the execution of this command. |
|
List<Command<E>> |
CompositeCommand.getCommands()
Returns the commands currently
associated with this composite command, in order. |
|
Iterator<Command<E>> |
CompositeCommand.iterator()
Returns an iterator to iterate through this composite command, which is backed by this composite commands, i.e. |
|
private static
|
Main.test1(Log out,
Sequence<E> sequence,
Boolean fail)
Creates command for the first composite test. |
|
private static
|
Main.test2(Log out,
Sequence<E> sequence,
Boolean fail)
Creates command for the second composite test. |
Methods in dk.rode.thesis.command with parameters of type Command | ||
---|---|---|
boolean |
CompositeCommand.addCommand(Command<E> command)
Associates the command supplied
as command to this composite command, if
not already. |
|
|
CommandProcessor.execute(Command<E>... commands)
Executes the commands supplied as
commands , in order, or tries to undo executed commands in case of execution failure. |
|
boolean |
CompositeCommand.removeCommand(Command<?> command)
Removes the command supplied
as command from this composite command, if
associated. |
Method parameters in dk.rode.thesis.command with type arguments of type Command | ||
---|---|---|
|
CommandProcessor.execute(List<Command<E>> commands)
Executes the commands supplied as
commands , in order, or tries to undo executed commands in case of execution failure. |
|
private
|
CommandProcessor.execute(List<Command<E>> commands,
List<Command<E>> executedCommands)
Executes the commands supplied as
commands , in order, or tries to undo executed commands in case of execution failure. |
|
private
|
CommandProcessor.execute(List<Command<E>> commands,
List<Command<E>> executedCommands)
Executes the commands supplied as
commands , in order, or tries to undo executed commands in case of execution failure. |
|
private
|
CommandProcessor.undo(List<Command<E>> executedCommands)
Undoes the executed commands supplied as
executedCommands , if possible. |
Constructors in dk.rode.thesis.command with parameters of type Command | |
---|---|
CommandException(Command<?> command)
Constructor. |
|
CompositeCommand(Command<E>... commands)
Constructor, which adds each copies each command
in commands and adds it to this composite command. |
|
ReverseCommand(Sequence<E> sequence,
Command<E>... commands)
Constructor. |
Uses of Command in dk.rode.thesis.factorymethod |
---|
Methods in dk.rode.thesis.factorymethod that return Command | |
---|---|
protected Command<E> |
SequenceCommandCreator.create(Sequence<E> sequence,
Sequence.State state)
|
protected Command<E> |
ReversibleSequenceCommandCreator.create(Sequence<E> sequence,
Sequence.State state)
|
protected Command<E> |
EvilSequenceCommandCreator.create(Sequence<E> sequence,
Sequence.State state)
|
protected abstract Command<E> |
CommandCreator.create(Sequence<E> sequence,
T token)
Factory method to create a new command of the
type specified by the token supplied as token . |
protected Command<E> |
ReflectiveCommandCreator.create(Sequence<E> sequence,
TypeLiteral<? extends Command<E>> type)
|
protected Command<E> |
CommandCreator.createDefault(Sequence<E> sequence)
Factory method to create a new default command in case the normal command creation
failed. |
Command<E> |
CommandCreator.getCommand(Sequence<E> sequence,
T token)
Returns a new command instance of the type identified by token
associated with the sequence receiver supplied
at sequence . |
Method parameters in dk.rode.thesis.factorymethod with type arguments of type Command | ||
---|---|---|
protected Command<E> |
ReflectiveCommandCreator.create(Sequence<E> sequence,
TypeLiteral<? extends Command<E>> type)
|
|
private static
|
Main.testFactory(Log out,
Sequence<E> sequence,
int index,
List<Factory<? extends Command<E>>> factories)
Tests the factories supplied in factories that creates commands
based on sequence as the single argument. |
|
Gunni Rode / rode.dk | ||||||||
PREV NEXT | FRAMES NO FRAMES |