Serializable
, EventEmitter.EventObserver
public class TextOutputHandler extends OutputHandler implements Serializable
Modifier and Type | Class | Description |
---|---|---|
static interface |
TextOutputHandler.LineOutput |
OutputHandler.ANTICIPATE, OutputHandler.CONFIRM, OutputHandler.DISAPPOINT, OutputHandler.ECHO, OutputHandler.ERR, OutputHandler.EXE, OutputHandler.IN, OutputHandler.OUT
Modifier and Type | Field | Description |
---|---|---|
private float |
minPriority |
|
private Nar |
nar |
|
private PrintWriter |
outExp |
|
private TextOutputHandler.LineOutput |
outExp2 |
|
private String |
prefix |
|
(package private) StringBuilder |
result |
|
private boolean |
showErrors |
|
private boolean |
showInput |
|
private boolean |
showStackTrace |
|
private boolean |
showStamp |
active, source
DefaultOutputEvents
Constructor | Description |
---|---|
TextOutputHandler(Nar n) |
Default constructor; adds the reasoner to a Nar's outptu channels
|
TextOutputHandler(Nar n,
PrintStream ps) |
|
TextOutputHandler(Nar n,
PrintStream ps,
float minPriority) |
|
TextOutputHandler(Nar n,
PrintWriter outExp) |
|
TextOutputHandler(Nar n,
PrintWriter outExp,
float minPriority) |
|
TextOutputHandler(Nar n,
StringWriter s) |
|
TextOutputHandler(Nar n,
TextOutputHandler.LineOutput outExp2) |
Modifier and Type | Method | Description |
---|---|---|
void |
closeSaveFile() |
Close an output experience file
|
void |
event(Class channel,
Object... oo) |
Process the next chunk of output data
|
static CharSequence |
getOutputString(Class channel,
Object signal,
boolean showChannel,
boolean showStamp,
Nar nar) |
|
static String |
getOutputString(Class channel,
Object signal,
boolean showChannel,
boolean showStamp,
Nar nar,
StringBuilder buffer) |
|
static String |
getOutputString(Class channel,
Object signal,
boolean showChannel,
boolean showStamp,
Nar nar,
StringBuilder buffer,
float minPriority) |
generates a human-readable string from an output channel and signal
|
static CharSequence |
getOutputString(Class channel,
Object signal,
boolean showStamp,
Nar nar) |
|
static CharSequence |
getOutputString(Class channel,
Object signal,
boolean showStamp,
Nar nar,
StringBuilder buffer) |
generates a human-readable string from an output channel and signal
|
void |
openSaveFile(String path) |
Open an output experience file
|
String |
process(Class c,
Object o) |
|
TextOutputHandler |
setErrors(boolean errors) |
|
TextOutputHandler |
setErrorStackTrace(boolean b) |
|
TextOutputHandler |
setLinePrefix(String prefix) |
|
TextOutputHandler |
setShowInput(boolean showInput) |
isActive, setActive
private final Nar nar
private String prefix
private TextOutputHandler.LineOutput outExp2
private PrintWriter outExp
private boolean showErrors
private boolean showStackTrace
private final boolean showStamp
private boolean showInput
private float minPriority
final StringBuilder result
public TextOutputHandler(Nar n)
n
- public TextOutputHandler(Nar n, TextOutputHandler.LineOutput outExp2)
public TextOutputHandler(Nar n, PrintWriter outExp)
public TextOutputHandler(Nar n, PrintWriter outExp, float minPriority)
public TextOutputHandler(Nar n, PrintStream ps)
public TextOutputHandler(Nar n, PrintStream ps, float minPriority)
public TextOutputHandler(Nar n, StringWriter s)
public void openSaveFile(String path)
public void closeSaveFile()
public void event(Class channel, Object... oo)
event
in interface EventEmitter.EventObserver
public TextOutputHandler setErrors(boolean errors)
public TextOutputHandler setShowInput(boolean showInput)
public TextOutputHandler setErrorStackTrace(boolean b)
public TextOutputHandler setLinePrefix(String prefix)
public static String getOutputString(Class channel, Object signal, boolean showChannel, boolean showStamp, Nar nar, StringBuilder buffer)
public static String getOutputString(Class channel, Object signal, boolean showChannel, boolean showStamp, Nar nar, StringBuilder buffer, float minPriority)
public static CharSequence getOutputString(Class channel, Object signal, boolean showChannel, boolean showStamp, Nar nar)
public static CharSequence getOutputString(Class channel, Object signal, boolean showStamp, Nar nar)
public static CharSequence getOutputString(Class channel, Object signal, boolean showStamp, Nar nar, StringBuilder buffer)
Copyright © 2020 OpenNARS. All rights reserved.