org.scijava.console
Class OutputEvent

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.event.SciJavaEvent
          extended by org.scijava.console.OutputEvent
All Implemented Interfaces:
Contextual

public class OutputEvent
extends SciJavaEvent

An event indicating output occurred on 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.

Author:
Curtis Rueden

Nested Class Summary
static class OutputEvent.Source
          Possible output sources.
 
Constructor Summary
OutputEvent(Context context, OutputEvent.Source source, String output, boolean contextual)
          Creates a new output event.
 
Method Summary
 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()
           
 
Methods inherited from class org.scijava.event.SciJavaEvent
consume, getCallingThread, getStackTrace, isConsumed, setCallingThread, setConsumed
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 SciJava Context.
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 SciJava Context.


isStdout

public boolean isStdout()
Returns true of the source of the output is stdout.


isStderr

public boolean isStderr()
Returns true of the source of the output is stderr.


toString

public String toString()
Overrides:
toString in class SciJavaEvent


Copyright © 2009–2015 SciJava. All rights reserved.