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() |
BroadWorksServer |
getBroadWorksServer() |
abstract Location |
getChildLocation(String locationName) |
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 |
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 |
pwd()
Print the locations current directory
|
abstract void |
refresh() |
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 |
setConnection(BroadWorksConnection connection) |
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 AlpacaException
location
- The location the command is being called fromlocationCommandTree
- The locations command treecommandTreeToCommandMap
- The locations commandTreeToCommandMapargs
- The argumentsAlpacaException
- Thrown if an error occurs while executing the command.public static HashMap<TreeNode<String>,Command> getRootLocationCommandMap()
public Alpaca getAlpaca()
public BroadWorksConnection getConnection()
public void setConnection(BroadWorksConnection connection)
public BroadWorksServer getBroadWorksServer()
public void displayHelp()
LocationCommandInterface
displayHelp
in interface LocationCommandInterface
public int execute(List<String> args) throws AlpacaException
LocationCommandInterface
execute
in interface LocationCommandInterface
AlpacaException
public List<ChildLocation> getChildren()
LocationCommandInterface
getChildren
in interface LocationCommandInterface
public void setChildren(List<ChildLocation> children)
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 void setName(String name)
public Location getParent()
LocationCommandInterface
getParent
in interface LocationCommandInterface
public void setParent(Location parent)
public String getPwd()
LocationCommandInterface
getPwd
in interface LocationCommandInterface
public void setPwd(String pwd)
public boolean isSystem()
LocationCommandInterface
isSystem
in interface LocationCommandInterface
public boolean isValid()
public void println(String s)
public void pwd()
LocationCommandInterface
pwd
in interface LocationCommandInterface
public void reset()
LocationCommandInterface
reset
in interface LocationCommandInterface
public void setIsValid(boolean isValid)
public abstract void refresh() throws BroadWorksObjectException
BroadWorksObjectException
Copyright © 2017 ECG. All rights reserved.