org.knime.base.node.mine.pca
Class PCAModelPortObject

java.lang.Object
  extended by org.knime.core.node.port.AbstractSimplePortObject
      extended by org.knime.base.node.mine.pca.PCAModelPortObject
All Implemented Interfaces:
PortObject

public class PCAModelPortObject
extends AbstractSimplePortObject

Port model object transporting the pca transformation.

Author:
uwe, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObject
PortObject.PortObjectSerializer<T extends PortObject>
 
Field Summary
static PortType TYPE
          Define port type of objects of this class when used as PortObjects.
 
Constructor Summary
PCAModelPortObject()
          empty constructor.
PCAModelPortObject(double[][] eigenVectors, double[] eigenvalues, String[] inputColumnNames, double[] center)
          construct port model object with values.
 
Method Summary
 double[] getCenter()
          get center of input data (for centering test data).
 double[] getEigenvalues()
           
 double[][] getEigenVectors()
           
 String[] getInputColumnNames()
          get names of input columns.
 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.
protected  void load(ModelContentRO model, PortObjectSpec spec, ExecutionMonitor exec)
          Loads the content into the freshly instantiated object.
protected  void save(ModelContentWO model, ExecutionMonitor exec)
          Saves this object to model content object.
 
Methods inherited from class org.knime.core.node.port.AbstractSimplePortObject
equals, getPortObjectSerializer, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final PortType TYPE
Define port type of objects of this class when used as PortObjects.

Constructor Detail

PCAModelPortObject

public PCAModelPortObject()
empty constructor.


PCAModelPortObject

public PCAModelPortObject(double[][] eigenVectors,
                          double[] eigenvalues,
                          String[] inputColumnNames,
                          double[] center)
construct port model object with values.

Parameters:
eigenVectors - eigenvectors of pca matrix
eigenvalues - eigenvalues of pca matrix
inputColumnNames - names of input columns
center - center of original data (data must be centered)
Method Detail

getCenter

public double[] getCenter()
get center of input data (for centering test data).

Returns:
center

getInputColumnNames

public String[] getInputColumnNames()
get names of input columns.

Returns:
names of input columns

getEigenvalues

public double[] getEigenvalues()
Returns:
eigenvalues of pca matrix

getEigenVectors

public double[][] getEigenVectors()
Returns:
eigenvectors of pca matrix

getSpec

public 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.

getSummary

public 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).

getViews

public 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.

Specified by:
getViews in interface PortObject
Overrides:
getViews in class AbstractSimplePortObject
Returns:
an array of views for the port object, each displayed as a tab in the out port view

load

protected void load(ModelContentRO model,
                    PortObjectSpec spec,
                    ExecutionMonitor exec)
             throws InvalidSettingsException,
                    CanceledExecutionException
Loads the content into the freshly instantiated object. This method is called at most once in the life time of the object (after the serializer has created a new object using the public no-arg constructor.)

Specified by:
load in class AbstractSimplePortObject
Parameters:
model - To load from.
spec - The accompanying spec (which can be safely cast to the expected class).
exec - For progress/cancelation.
Throws:
InvalidSettingsException - If settings are incomplete/deficient.
CanceledExecutionException - If canceled.

save

protected void save(ModelContentWO model,
                    ExecutionMonitor exec)
             throws CanceledExecutionException
Saves this object to model content object.

Specified by:
save in class AbstractSimplePortObject
Parameters:
model - To save to.
exec - For progress/cancelation.
Throws:
CanceledExecutionException - If canceled.


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.