org.knime.core.node.workflow
Class NodeOutPortWrapper

java.lang.Object
  extended by org.knime.core.node.workflow.NodePortAdaptor
      extended by org.knime.core.node.workflow.NodeOutPortWrapper
All Implemented Interfaces:
NodeOutPort, NodePort, NodeStateChangeListener
Direct Known Subclasses:
WorkflowOutPort

public class NodeOutPortWrapper
extends NodePortAdaptor
implements NodeOutPort

Author:
B. Wiswedel, M. Berthold, University of Konstanz

Constructor Summary
NodeOutPortWrapper(int portIndex, PortType pType)
          Creates a new output port with a fixed type and index (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.
 boolean equals(Object obj)
          
 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().
(package private)  NodeOutPort getUnderlyingPort()
           
 int hashCode()
          
 void notifyNodeStateChangeListener(NodeStateEvent e)
          
 void openPortView(String name)
          Opens the port view for this port with the given name.
 boolean removeNodeStateChangeListener(NodeStateChangeListener listener)
          
(package private)  void setUnderlyingPort(NodeOutPort p)
          Set a new underlying port - used when the connection inside this workflow to this outgoing port changes.
 void stateChanged(NodeStateEvent state)
          Callback from node, indicating that the given node has changed its state.
 String toString()
          
 
Methods inherited from class org.knime.core.node.workflow.NodePortAdaptor
getPortIndex, getPortName, getPortType, setPortName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.knime.core.node.workflow.NodePort
getPortIndex, getPortName, getPortType, setPortName
 

Constructor Detail

NodeOutPortWrapper

NodeOutPortWrapper(int portIndex,
                   PortType pType)
Creates a new output port with a fixed type and index (should unique to all other output ports of this node) for the given node.

Parameters:
pType - The port's type
portIndex - This port index
Method Detail

setUnderlyingPort

void setUnderlyingPort(NodeOutPort p)
Set a new underlying port - used when the connection inside this workflow to this outgoing port changes. The argument is the new NodeOutPort connected to the outgoing port of the WFM.

Parameters:
p - new port

getUnderlyingPort

NodeOutPort getUnderlyingPort()
Returns:
underlying NodeOutPort

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

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.

getPortObjectSpec

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

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

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

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

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.