Package org.mwolff.command
Interface CommandContainer<T>
-
- All Superinterfaces:
ChainCommand<T>
,Command<T>
,ProcessCommand<T>
- All Known Implementing Classes:
DefaultCommandContainer
public interface CommandContainer<T> extends ProcessCommand<T>
Interface of a command container. A command container implements all command interfaces. So you can execute commandContainer as usual commands. Actually this implements the composite pattern. So you can mix commands and command container to build chains.- Author:
- Manfred Wolff
-
-
Field Summary
-
Fields inherited from interface org.mwolff.command.process.ProcessCommand
END
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandContainer<T>
addCommand(int priority, Command<T> command)
Adds aCommand
to the list via priority.CommandContainer<T>
addCommand(Command<T> parameterObject)
Adds aCommand
to the list.Optional<ProcessCommand<T>>
getCommandByProcessID(String processID)
Gets the command with the certain processID.-
Methods inherited from interface org.mwolff.command.chain.ChainCommand
executeCommandAsChain
-
Methods inherited from interface org.mwolff.command.Command
executeCommand
-
Methods inherited from interface org.mwolff.command.process.ProcessCommand
addTransition, executeAsProcess, executeAsProcess, findNext, getProcessID, getTransitionList, setProcessID
-
-
-
-
Method Detail
-
addCommand
CommandContainer<T> addCommand(Command<T> parameterObject)
Adds aCommand
to the list. Because aCommandContainer
is aCommand
you can addCommandContainer
objects as well.- Parameters:
parameterObject
- The command to add.- Returns:
- this
-
addCommand
CommandContainer<T> addCommand(int priority, Command<T> command)
Adds aCommand
to the list via priority. Because aCommandContainer
is aCommand
you can addCommandContainer
objects as well.- Parameters:
priority
- A priority. If two commands has the same priority the first wins.command
- The command to add.- Returns:
- this
-
getCommandByProcessID
Optional<ProcessCommand<T>> getCommandByProcessID(String processID)
Gets the command with the certain processID.- Parameters:
processID
- The id to find the command.- Returns:
- The command with the certain processID
-
-