public abstract class Location extends Object implements LocationCommandInterface
Modifier and Type | Method and Description |
---|---|
static void |
addCommandToTree(Command command) |
static TreeNode<String> |
addCommandToTree(Command command,
TreeNode<String> commandTree)
Adds a command to the Locations Command Tree
|
void |
displayHelp()
Command help description.
|
int |
execute(List<String> args)
Executes this command.
|
static int |
execute(Location location,
TreeNode<String> locationCommandTree,
HashMap<TreeNode<String>,Command> commandTreeToCommandMap,
List<String> args,
boolean quiet)
Generic Execution method for Running a command from a given Location
|
Alpaca |
getAlpaca() |
co.ecg.alpaca.toolkit.model.BroadWorksServer |
getBroadWorksServer() |
List<ChildLocation> |
getChildren()
Retrieve Children Locations
|
TreeNode<String> |
getCommandTree()
Returns the command tree
|
HashMap<TreeNode<String>,Command> |
getCommandTreeMap()
Returns the command tree map
|
BroadWorksConnection |
getConnection() |
String |
getName()
Command Name
|
Location |
getParent()
Returns the parent object of this location
|
String |
getPwd()
Get the current location as String
|
static HashMap<TreeNode<String>,Command> |
getRootLocationCommandMap() |
static TreeNode<String> |
getRootLocationCommandTree() |
boolean |
isHelpRequest(String argument)
Determines if the given argument term matches reserved help keywords
|
boolean |
isSystem()
True IFF this location is the System object
|
boolean |
isValid() |
void |
println(String s)
This method determines how locations print information to the console
|
void |
printLocalOptions(TreeNode<String> currentNode,
HashMap<TreeNode<String>,Command> commandTreeToCommandMap)
Print details on optional arguments from current command location
|
void |
pwd()
Print the locations current directory
|
void |
reset()
Resets the object following use;
|
void |
setChildren(List<ChildLocation> children) |
void |
setCommandMap(HashMap<TreeNode<String>,Command> commandMap) |
void |
setCommands(TreeNode<String> commands) |
void |
setIsSystem(boolean isSystem) |
void |
setIsValid(boolean isValid) |
void |
setName(String name) |
void |
setParent(Location parent) |
void |
setPwd(String pwd) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
populateChildren
public static void addCommandToTree(Command command)
public static TreeNode<String> addCommandToTree(Command command, TreeNode<String> commandTree)
command
- The Command to AddcommandTree
- The Command Tree to Add topublic static int execute(Location location, TreeNode<String> locationCommandTree, HashMap<TreeNode<String>,Command> commandTreeToCommandMap, List<String> args, boolean quiet) throws co.ecg.alpaca.toolkit.exception.AlpacaException
location
- The location the command is being called fromlocationCommandTree
- The locations command treecommandTreeToCommandMap
- The locations commandTreeToCommandMapargs
- The argumentsco.ecg.alpaca.toolkit.exception.AlpacaException
public static HashMap<TreeNode<String>,Command> getRootLocationCommandMap()
public Alpaca getAlpaca()
public BroadWorksConnection getConnection()
public co.ecg.alpaca.toolkit.model.BroadWorksServer getBroadWorksServer()
public void displayHelp()
LocationCommandInterface
displayHelp
in interface LocationCommandInterface
public int execute(List<String> args) throws co.ecg.alpaca.toolkit.exception.AlpacaException
LocationCommandInterface
execute
in interface LocationCommandInterface
co.ecg.alpaca.toolkit.exception.AlpacaException
public List<ChildLocation> getChildren()
LocationCommandInterface
getChildren
in interface LocationCommandInterface
public TreeNode<String> getCommandTree()
LocationCommandInterface
getCommandTree
in interface LocationCommandInterface
public HashMap<TreeNode<String>,Command> getCommandTreeMap()
LocationCommandInterface
getCommandTreeMap
in interface LocationCommandInterface
public String getName()
LocationCommandInterface
getName
in interface LocationCommandInterface
public Location getParent()
LocationCommandInterface
getParent
in interface LocationCommandInterface
public String getPwd()
LocationCommandInterface
getPwd
in interface LocationCommandInterface
public boolean isHelpRequest(String argument)
argument
- public boolean isSystem()
LocationCommandInterface
isSystem
in interface LocationCommandInterface
public boolean isValid()
public void println(String s)
public void printLocalOptions(TreeNode<String> currentNode, HashMap<TreeNode<String>,Command> commandTreeToCommandMap)
public void pwd()
LocationCommandInterface
pwd
in interface LocationCommandInterface
public void reset()
LocationCommandInterface
reset
in interface LocationCommandInterface
public void setChildren(List<ChildLocation> children)
public void setIsSystem(boolean isSystem)
public void setIsValid(boolean isValid)
public void setName(String name)
public void setParent(Location parent)
public void setPwd(String pwd)
Copyright © 2016. All rights reserved.