org.knime.base.node.preproc.discretization.caim2
Class DiscretizationModel

java.lang.Object
  extended by org.knime.core.node.port.AbstractSimplePortObject
      extended by org.knime.base.node.preproc.discretization.caim2.DiscretizationModel
All Implemented Interfaces:
PortObject

public class DiscretizationModel
extends AbstractSimplePortObject

Contains the DiscretizationSchemes for a given columns.

Author:
Christoph, 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
          Convenience method to get the type of this port object.
 
Constructor Summary
DiscretizationModel()
          Creates an empty and invalid model! Don't use the created instance until loading content.
DiscretizationModel(DiscretizationScheme[] schemes, DataTableSpec includedColumns)
          Creates a new model taking over the schemes (copying them) and storing the included columns.
DiscretizationModel(ModelContentRO content, DataTableSpec includedCols)
          Creates a DiscretizationModel from a ModelContentRO object.
 
Method Summary
 String[] getIncludedColumnNames()
          Returns names of the columns that are included in the DiscretizationModel.
 DiscretizationScheme[] getSchemes()
          Returns DiscretizationSchemes of the columns that are included in the DiscretizationModel.
 PortObjectSpec getSpec()
          Get specification to this port object.
 String getSummary()
          Get a short summary of this PortObject.
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.
 void saveToModelContent(ModelContentWO modelContent)
          Saves this model to a ModelContentWO object.
 
Methods inherited from class org.knime.core.node.port.AbstractSimplePortObject
equals, getPortObjectSerializer, getViews, 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
Convenience method to get the type of this port object.

Constructor Detail

DiscretizationModel

public DiscretizationModel(ModelContentRO content,
                           DataTableSpec includedCols)
                    throws InvalidSettingsException
Creates a DiscretizationModel from a ModelContentRO object.

Parameters:
content - the content object to restore the model from
includedCols - the columns included when building in the model
Throws:
InvalidSettingsException - if the model content is not valid

DiscretizationModel

public DiscretizationModel()
Creates an empty and invalid model! Don't use the created instance until loading content.

See Also:
load(ModelContentRO, PortObjectSpec, ExecutionMonitor)

DiscretizationModel

public DiscretizationModel(DiscretizationScheme[] schemes,
                           DataTableSpec includedColumns)
Creates a new model taking over the schemes (copying them) and storing the included columns.

Parameters:
schemes - the schemes for this model
includedColumns - the included columns, used to build the schemes
Method Detail

getIncludedColumnNames

public String[] getIncludedColumnNames()
Returns names of the columns that are included in the DiscretizationModel.

Returns:
the names of the columns that are included in the DiscretizationModel.

getSchemes

public DiscretizationScheme[] getSchemes()
Returns DiscretizationSchemes of the columns that are included in the DiscretizationModel.

Returns:
the DiscretizationSchemes of the columns that are included in the DiscretizationModel.

saveToModelContent

public void saveToModelContent(ModelContentWO modelContent)
Saves this model to a ModelContentWO object.

Parameters:
modelContent - the ModelContentWO object to store the DiscretizationModel to

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

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

IMPORTANT NOTE: This method DOES NOT load the table spec of included columns from the provided model. This table spec must be loaded before and must be provided here. It is taken over and stored.

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.

IMPORTANT NOTE: This method DOES NOT save the table spec of included columns. This table spec must be saved before (by calling getSpec and saving the returned 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.