public class ExtVisitor extends java.lang.Object implements IExtVisitor
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,IExtVisitorCmd> |
cmds
Dictionary of commands keyed to a String id.
|
private IExtVisitorCmd |
defaultCmd
Default command used when unknown case is encountered.
|
private java.lang.String |
name
Identifying name for this visitor
|
Constructor and Description |
---|
ExtVisitor(java.lang.String name)
Constructor for the class
|
Modifier and Type | Method and Description |
---|---|
void |
addCmd(java.lang.String id,
IExtVisitorCmd cmd)
Add or replace the command associated with the given id.
|
java.lang.Object |
caseAt(java.lang.String id,
IHost host,
java.lang.Object... params)
The parameterized case method that the host calls, handing it its ID.
|
java.lang.String |
toString()
Returns a string representation of the visitor, which is its name prepended with "ExtVisitor_".
|
private java.lang.String name
private java.util.Map<java.lang.String,IExtVisitorCmd> cmds
private IExtVisitorCmd defaultCmd
public ExtVisitor(java.lang.String name)
name
- The identifying string for the classpublic java.lang.Object caseAt(java.lang.String id, IHost host, java.lang.Object... params)
IExtVisitor
caseAt
in interface IExtVisitor
id
- The ID of the hosthost
- The host itselfparams
- Any parameters the visitor might need to perform its output.public java.lang.String toString()
toString
in class java.lang.Object
public void addCmd(java.lang.String id, IExtVisitorCmd cmd)
id
- The id with which to associate the given commandcmd
- The command to associate wtih the given key.