org.knime.core.node.port
Interface PortObject

All Known Subinterfaces:
RegressionPortObject
All Known Implementing Classes:
AbstractPortObject, AbstractSimplePortObject, BasisFunctionPortObject, BufferedDataTable, BWElimModel, ColorHandlerPortObject, DatabasePortObject, DiscretizationModel, FlowVariablePortObject, FuzzyBasisFunctionPortObject, NaiveBayesPortObject, NormalizerPortObject, PCAModelPortObject, PMCCPortObjectAndSpec, PMMLAssociationRulePortObject, PMMLClusterPortObject, PMMLDecisionTreePortObject, PMMLNeuralNetworkPortObject, PMMLPortObject, PMMLRegressionPortObject, PMMLSVMPortObject, RadialBasisFunctionPortObject, ShapeHandlerPortObject, SizeHandlerPortObject, SotaPortObject, ViewPropertyPortObject

public interface PortObject

General interface for objects that are passed along node connections. Most prominent example of such an object is BufferedDataTable. PortObjects contain the actual data or models, which are used during a node's execution.

Important: Implementors of this interface must also provide a PortObject.PortObjectSerializer, which is used to save and load instances. The framework will try to invoke a static method defined in the implementation with the following signature:

  public static PortObjectSerializer<FooPortObject> 
          getPortObjectSerializer();
 
If the class does not have such a static method (or it has the wrong signature), an exception will be thrown at runtime. There are two exceptions to this rule: Objects of class BufferedDataTable and ModelContent are treated separately. As such, they do not define this method (or their implementations throw an exception as the method is not called by the framework). However, if you do not extend either of these two classes, you do need to implement the method mentioned above.

Note: The API of this class is not finalized and may slightly change in future versions.

Since:
2.0
Author:
Bernd Wiswedel & Michael Berthold, University of Konstanz
See Also:
BufferedDataTable, PortObjectSpec, PortType, AbstractPortObject, AbstractSimplePortObject

Nested Class Summary
static class PortObject.PortObjectSerializer<T extends PortObject>
          Factory class that's used for writing and loading objects of class denoted by T.
 
Method Summary
 PortObjectSpec getSpec()
          Get specification to this port object.
 String getSummary()
          Get a short summary of this PortObject.
 JComponent[] getViews()
          The returned views are displayed in the out port view of the referring node.
 

Method Detail

getSummary

String getSummary()
Get a short summary of this PortObject. The return value will be shown in a node port's tooltip, for instance.

Returns:
Summary of the object's content, suitable for a tooltip. Empty strings and null result values are ok (though not encouraged).

getSpec

PortObjectSpec getSpec()
Get specification to this port object. That is, the corresponding PortObjectSpec which is used to configure any successor node after execution, e.g. a BufferedDataTable can return a DataTableSpec.

Subclasses should narrow the return type if possible.

Returns:
underlying PortObjectSpec or any derived spec, never null.

getViews

JComponent[] getViews()
The returned views are displayed in the out port view of the referring node. Each component is displayed in an extra tab. The name of the component is used as the title for the tab. It is important that no external members are kept in the component so it can be deleted, when the port object is deleted. If the port object has no view return an empty array.

Returns:
an array of views for the port object, each displayed as a tab in the out port view


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.