org.knime.core.node.workflow
Class NodeContainerOutPort

java.lang.Object
  extended by org.knime.core.node.workflow.NodePortAdaptor
      extended by org.knime.core.node.workflow.NodeContainerOutPort
All Implemented Interfaces:
NodeOutPort, NodePort, NodeStateChangeListener

public class NodeContainerOutPort
extends NodePortAdaptor
implements NodeOutPort

The implementation of an OutPort of a SingleNodeContainer - e.g. a "real" node.

Author:
M. Berthold, University of Konstanz

Constructor Summary
NodeContainerOutPort(SingleNodeContainer snc, int portIndex)
          Creates a new output port with a fixed and ID (should unique to all other output ports of this node) for the given node.
 
Method Summary
 boolean addNodeStateChangeListener(NodeStateChangeListener listener)
          
 void disposePortView()
          Dispose the view (if any) associated with this port.
protected  void finalize()
          
 FlowObjectStack getFlowObjectStack()
          Returns the FlowObjectStack of the underlying node.
 HiLiteHandler getHiLiteHandler()
          Returns the hilite handler for this port as set by the node this port is output for.
 NodeContainer.State getNodeState()
          
 PortObject getPortObject()
          Returns the DataTable for this port, as set by the node this port is output for.
 PortObjectSpec getPortObjectSpec()
          Returns the DataTableSpec or null if not available.
 String getPortSummary()
          Get summary of the underlying port object as provided by PortObject.getSummary().
protected  OutPortView getPortView()
          Returns the port view for this output port which can be null.
 void notifyNodeStateChangeListener(NodeStateEvent e)
          
 void openPortView(String name)
          Opens the port view for this port with the given name.
 boolean removeNodeStateChangeListener(NodeStateChangeListener listener)
          
 void stateChanged(NodeStateEvent state)
          Callback from node, indicating that the given node has changed its state.
 
Methods inherited from class org.knime.core.node.workflow.NodePortAdaptor
getPortIndex, getPortName, getPortType, setPortName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.knime.core.node.workflow.NodePort
getPortIndex, getPortName, getPortType, setPortName
 

Constructor Detail

NodeContainerOutPort

public NodeContainerOutPort(SingleNodeContainer snc,
                            int portIndex)
Creates a new output port with a fixed and ID (should unique to all other output ports of this node) for the given node.

Parameters:
snc - the underlying SingleNodeContainer.
portIndex - the (output) port index.
Method Detail

getPortObjectSpec

public PortObjectSpec getPortObjectSpec()
Returns the DataTableSpec or null if not available.

Specified by:
getPortObjectSpec in interface NodeOutPort
Returns:
The DataTableSpec for this port.

getPortObject

public PortObject getPortObject()
Returns the DataTable for this port, as set by the node this port is output for.

Specified by:
getPortObject in interface NodeOutPort
Returns:
PortObject the object for this port. Can be null.

getPortSummary

public String getPortSummary()
Get summary of the underlying port object as provided by PortObject.getSummary(). It's a separate method since calling getPortObject().getSummary() may force the underlying table (if it is a table) to restore its content from disc. Summaries are saved in the workflow file (or the node's corresponding sub directory).

Specified by:
getPortSummary in interface NodeOutPort
Returns:
The port object's summary.

getNodeState

public NodeContainer.State getNodeState()

Specified by:
getNodeState in interface NodeOutPort
Returns:
the state of the node owning this port.

getHiLiteHandler

public HiLiteHandler getHiLiteHandler()
Returns the hilite handler for this port as set by the node this port is output for.

Specified by:
getHiLiteHandler in interface NodeOutPort
Returns:
The HiLiteHandler for this port or null.

getFlowObjectStack

public FlowObjectStack getFlowObjectStack()
Returns the FlowObjectStack of the underlying node.

Specified by:
getFlowObjectStack in interface NodeOutPort
Returns:
the flow obj stack container

getPortView

protected final OutPortView getPortView()
Returns the port view for this output port which can be null.

Returns:
The port view or null.

openPortView

public void openPortView(String name)
Opens the port view for this port with the given name.

Specified by:
openPortView in interface NodeOutPort
Parameters:
name - The name of the port view.

disposePortView

public void disposePortView()
Dispose the view (if any) associated with this port.

Specified by:
disposePortView in interface NodeOutPort

finalize

protected void finalize()
                 throws Throwable

Overrides:
finalize in class Object
Throws:
Throwable

addNodeStateChangeListener

public boolean addNodeStateChangeListener(NodeStateChangeListener listener)

Specified by:
addNodeStateChangeListener in interface NodeOutPort
Parameters:
listener - a listener to the state of the port, that is the state of the predecessor node
Returns:
true if the listener was added, false if it was already registered

notifyNodeStateChangeListener

public void notifyNodeStateChangeListener(NodeStateEvent e)

Specified by:
notifyNodeStateChangeListener in interface NodeOutPort
Parameters:
e - the event which should be forwarded to all regsitered NodeStateChangeListeners

removeNodeStateChangeListener

public boolean removeNodeStateChangeListener(NodeStateChangeListener listener)

Specified by:
removeNodeStateChangeListener in interface NodeOutPort
Parameters:
listener - the listener to be de-registered
Returns:
true if it was successfully removed, false if it was not registered

stateChanged

public void stateChanged(NodeStateEvent state)
Callback from node, indicating that the given node has changed its state. Clients may observe the node in order to get the current state.

Specified by:
stateChanged in interface NodeStateChangeListener
Parameters:
state - Indicates the change of this node.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.