public class DemoModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private IViewAdapter |
view |
Constructor and Description |
---|
DemoModel(IViewAdapter view)
Constructor for the class
|
Modifier and Type | Method and Description |
---|---|
void |
addCmd(ExtVisitor visitor,
java.lang.String id,
java.lang.String resultStr)
Add or replace a command in the given visitor that returns the given result string.
|
IHost |
makeHost(java.lang.String id)
Returns a new IHost with the given id
|
ExtVisitor |
makeVisitor(java.lang.String name)
Return a new visitor with the given name
|
java.lang.Object |
run(IHost host,
IExtVisitor visitor)
Execute the given visitor on the given host, with no input parameters.
|
void |
start()
Starts the model.
|
private IViewAdapter view
public DemoModel(IViewAdapter view)
view
- The adapter to the viewpublic IHost makeHost(java.lang.String id)
id
- The id of the new hostpublic java.lang.Object run(IHost host, IExtVisitor visitor)
host
- The host to usevisitor
- The visitor to usepublic ExtVisitor makeVisitor(java.lang.String name)
name
- The new visitor's toString() method returns "ExtVisitor_"+namepublic void addCmd(ExtVisitor visitor, java.lang.String id, java.lang.String resultStr)
visitor
- The visitor to useid
- The id of the host associated with the new commandresultStr
- The string to be returned when the visitor is run on a host with the given id.public void start()