org.knime.base.node.mine.sota
Class SotaPortObjectSpec

java.lang.Object
  extended by org.knime.core.node.port.AbstractSimplePortObjectSpec
      extended by org.knime.base.node.mine.sota.SotaPortObjectSpec
All Implemented Interfaces:
PortObjectSpec

public class SotaPortObjectSpec
extends AbstractSimplePortObjectSpec

Provides the spec of the sota port model and a validation method, to validate if a certain data table spec is compatible to the model spec.

Author:
Kilian Thiel, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObjectSpec
PortObjectSpec.PortObjectSpecSerializer<T extends PortObjectSpec>
 
Constructor Summary
SotaPortObjectSpec()
           
SotaPortObjectSpec(DataTableSpec spec, int indexOfClassCol)
          Creates a new instance of SotaPortObjectSpec with the given data table spec, as the main part of the model spec and the index of the class column.
 
Method Summary
 DataTableSpec getSpec()
           
 boolean hasClassColumn()
           
protected  void load(ModelContentRO model)
          Loads the content into the freshly instantiated object.
protected  void save(ModelContentWO model)
          Saves this object to model content object.
 boolean validateSpec(DataTableSpec spec)
          Validates if the given data table spec is compatible to the model port spec and returns true if so, otherwise false.
 
Methods inherited from class org.knime.core.node.port.AbstractSimplePortObjectSpec
equals, getPortObjectSpecSerializer, getViews, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SotaPortObjectSpec

public SotaPortObjectSpec()

SotaPortObjectSpec

public SotaPortObjectSpec(DataTableSpec spec,
                          int indexOfClassCol)
Creates a new instance of SotaPortObjectSpec with the given data table spec, as the main part of the model spec and the index of the class column.

Parameters:
spec - The data table spec to store.
indexOfClassCol - The index of the class column.
Method Detail

load

protected void load(ModelContentRO model)
             throws InvalidSettingsException
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 AbstractSimplePortObjectSpec
Parameters:
model - To load from.
Throws:
InvalidSettingsException - If settings are incomplete/deficient.

save

protected void save(ModelContentWO model)
Saves this object to model content object.

Specified by:
save in class AbstractSimplePortObjectSpec
Parameters:
model - To save to.

getSpec

public DataTableSpec getSpec()
Returns:
the spec

validateSpec

public boolean validateSpec(DataTableSpec spec)
Validates if the given data table spec is compatible to the model port spec and returns true if so, otherwise false.

Parameters:
spec - The data table spec to validate.
Returns:
true if given spec is compatible to the model port spec, otherwise false.

hasClassColumn

public boolean hasClassColumn()
Returns:
true if internal data table spec contains a column which is compatible to string value.


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.