Package org.scijava.console
Class OutputEvent
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.event.SciJavaEvent
-
- org.scijava.console.OutputEvent
-
- All Implemented Interfaces:
Contextual
public class OutputEvent extends SciJavaEvent
An event indicating output occurred onstdoutorstderr.NB: This event is published on the calling thread by
ConsoleService.notifyListeners(OutputEvent), not on a dedicated event dispatch thread by theEventService. 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.- Author:
- Curtis Rueden
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOutputEvent.SourcePossible output sources.
-
Constructor Summary
Constructors Constructor Description OutputEvent(Context context, OutputEvent.Source source, String output, boolean contextual)Creates a new output event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetOutput()Gets the output string.OutputEvent.SourcegetSource()Gets the source of the output.booleanisContextual()Returns true if the output was produced outside of a specific SciJavaContext.booleanisStderr()Returns true of the source of the output isstderr.booleanisStdout()Returns true of the source of the output isstdout.StringtoString()-
Methods inherited from class org.scijava.event.SciJavaEvent
consume, dumpStack, getCallingThread, getStackTrace, isConsumed, setCallingThread, setConsumed
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
setContext
-
-
-
-
Constructor Detail
-
OutputEvent
public OutputEvent(Context context, OutputEvent.Source source, String output, boolean contextual)
Creates a new output event.- Parameters:
source- The source of the output.output- The output string.contextual- Whether the output was produced within this specific SciJavaContext.
-
-
Method Detail
-
getSource
public OutputEvent.Source getSource()
Gets the source of the output.
-
getOutput
public String getOutput()
Gets the output string.
-
isContextual
public boolean isContextual()
Returns true if the output was produced outside of a specific SciJavaContext.
-
isStdout
public boolean isStdout()
Returns true of the source of the output isstdout.
-
isStderr
public boolean isStderr()
Returns true of the source of the output isstderr.
-
toString
public String toString()
- Overrides:
toStringin classSciJavaEvent
-
-