public class SwitchArg extends Object implements Statement, AcceptsStatementVisitor
| Modifier and Type | Field and Description |
|---|---|
static Map<OsFamily,String> |
OS_TO_CASE_PATTERN |
static Map<OsFamily,String> |
OS_TO_END_SWITCH_PATTERN |
static Map<OsFamily,String> |
OS_TO_SWITCH_PATTERN |
| Constructor and Description |
|---|
SwitchArg(int arg,
Map<String,Statement> valueToActions)
Generates a switch statement based on
arg. |
public SwitchArg(int arg,
Map<String,Statement> valueToActions)
arg. If its value is found to be a key in
valueToActions, the corresponding action is invoked.
Ex. arg is 1 - the first argument to the script./script start ./script stop arg - - shell arg to switch onvalueToActions - - case statements, if the value of the arg matches a key, the corresponding value
will be invoked.public Iterable<String> functionDependencies(OsFamily family)
functionDependencies in interface Statementpublic void accept(StatementVisitor visitor)
accept in interface AcceptsStatementVisitorCopyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.