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

Uses of Interface
dk.rode.thesis.command.Command

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
<V extends Command<E>>
List<V>
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
<E> List<Command<E>>
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
<E> List<Command<E>>
Main.test1(Log out, Sequence<E> sequence, Boolean fail)
          Creates command for the first composite test.
private static
<E> List<Command<E>>
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.
<E> CommandProcessingResult<E>
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
<E> CommandProcessingResult<E>
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
<E> boolean
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
<E> boolean
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
<E> boolean
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
<E> boolean
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

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.