public class OutputEvent extends SciJavaEvent
stdout
or stderr
.
NB: This event is published on the calling thread by
ConsoleService.notifyListeners(OutputEvent)
, not on a
dedicated event dispatch thread by the EventService
. This is done to
avoid the overhead of the event service's synchronized pub/sub
implementation, as well as to avoid potential infinite output loops caused by
debugging output surrounding event publication.
Modifier and Type | Class and Description |
---|---|
static class |
OutputEvent.Source
Possible output sources.
|
Constructor and Description |
---|
OutputEvent(Context context,
OutputEvent.Source source,
String output,
boolean contextual)
Creates a new output event.
|
Modifier and Type | Method and Description |
---|---|
String |
getOutput()
Gets the output string.
|
OutputEvent.Source |
getSource()
Gets the source of the output.
|
boolean |
isContextual()
Returns true if the output was produced outside of a specific SciJava
Context . |
boolean |
isStderr()
Returns true of the source of the output is
stderr . |
boolean |
isStdout()
Returns true of the source of the output is
stdout . |
String |
toString() |
consume, dumpStack, getCallingThread, getStackTrace, isConsumed, setCallingThread, setConsumed
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setContext
public OutputEvent(Context context, OutputEvent.Source source, String output, boolean contextual)
source
- The source of the output.output
- The output string.contextual
- Whether the output was produced within this specific
SciJava Context
.public OutputEvent.Source getSource()
public String getOutput()
public boolean isContextual()
Context
.public boolean isStdout()
stdout
.public boolean isStderr()
stderr
.public String toString()
toString
in class SciJavaEvent
Copyright © 2015–2022 SciJava. All rights reserved.