public class BufferedAgentUI extends Object implements AgentUI
Modifier and Type | Field and Description |
---|---|
(package private) ByteArrayOutputStream |
outStream |
TYPE_ANY, TYPE_BOOLEAN, TYPE_FLOAT, TYPE_INT, TYPE_STRING
Constructor and Description |
---|
BufferedAgentUI() |
Modifier and Type | Method and Description |
---|---|
String |
ask(String prompt,
String help,
int type,
String _default)
The general contract is that the UI will return a string from the user
after prompting the use, that conforms to the the type specified by the
type parameter.
|
OutputStream |
getOutStream()
Returns an output stream that can be used to write to the interface
|
void |
print(String txt) |
void |
println(String txt) |
String |
result() |
void |
start()
This doesn't do anything in a text GUI.
|
boolean |
takesHTML() |
void |
update(Observable o,
Object arg) |
ByteArrayOutputStream outStream
public String ask(String prompt, String help, int type, String _default)
AgentUI
ask
in interface AgentUI
prompt
- The prompt the use will seehelp
- An extended prompt if the user enters something inappropriatetype
- The type which may be
Integer.parseInt(String)
Float.parseFloat(String)
_default
- The value to return (unchecked) if the user just hits [return]public void update(Observable o, Object arg)
public String result()
public void start()
public OutputStream getOutStream()
getOutStream
in interface AgentUI