protoj.core
Class CommandStore

java.lang.Object
  extended by protoj.core.CommandStore

public final class CommandStore
extends java.lang.Object

A repository of the application commands. A command can only be created by calling the addCommand(String, String, String, Runnable), which automatically ensures that command is added to this store.

Author:
Ashley Williams

Constructor Summary
CommandStore(CoreProject core)
          Accepts the parent of this instance.
 
Method Summary
 Command addCommand(java.lang.String name, java.lang.String description, java.lang.String maxMemory, java.lang.Runnable body)
          Adds a new command with the specified command body and that can execute in a new vm.
 Command getCommand(java.lang.String name)
          Looks up the command with the given name.
 java.util.Collection<Command> getCommands()
          Read-only access to the available commands.
 CoreProject getCore()
          The parent core for this store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandStore

public CommandStore(CoreProject core)
Accepts the parent of this instance.

Parameters:
core -
Method Detail

getCore

public CoreProject getCore()
The parent core for this store.

Returns:

addCommand

public Command addCommand(java.lang.String name,
                          java.lang.String description,
                          java.lang.String maxMemory,
                          java.lang.Runnable body)
Adds a new command with the specified command body and that can execute in a new vm. See Command.Command(CommandStore, String, String, String, Runnable) for a description of the parameters.

Parameters:
name -
description -
maxMemory -
body -
Returns:

getCommands

public java.util.Collection<Command> getCommands()
Read-only access to the available commands.

Returns:

getCommand

public Command getCommand(java.lang.String name)
Looks up the command with the given name. If no match is found then null is returned.

Parameters:
name -
Returns: