org.knime.core.data.property
Class ShapeModelNominal

java.lang.Object
  extended by org.knime.core.data.property.ShapeModelNominal
All Implemented Interfaces:
Iterable<DataCell>, ShapeHandler.ShapeModel

public final class ShapeModelNominal
extends Object
implements ShapeHandler.ShapeModel, Iterable<DataCell>

Nominal ShapeModel which maps a set of DataCell element to Shape.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
ShapeModelNominal(Map<DataCell,ShapeFactory.Shape> map)
          Creates new nominal ShapeModel based on a mapping.
 
Method Summary
 boolean equals(Object obj)
          
 ShapeFactory.Shape getShape(DataCell dc)
          Returns a Shape for the given DataCell value, or ShapeFactory.DEFAULT if not set.
 int hashCode()
          
 Iterator<DataCell> iterator()
          Returns an iterator over the keys.
static ShapeModelNominal load(ConfigRO config)
          Reads Shape settings from given Config and returns a new ShapeModelNominal object.
 String printShapeMapping()
           
 void save(ConfigWO config)
          Saves the DataCell to Shape mapping to the given Config.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShapeModelNominal

public ShapeModelNominal(Map<DataCell,ShapeFactory.Shape> map)
Creates new nominal ShapeModel based on a mapping.

Parameters:
map - Mapping form DataCell values to Shape objects.
Throws:
IllegalArgumentException - If the map is null.
Method Detail

getShape

public ShapeFactory.Shape getShape(DataCell dc)
Returns a Shape for the given DataCell value, or ShapeFactory.DEFAULT if not set.

Specified by:
getShape in interface ShapeHandler.ShapeModel
Parameters:
dc - A DataCell value to get shape for.
Returns:
A Shape for a DataCell value.

iterator

public Iterator<DataCell> iterator()
Returns an iterator over the keys.

Specified by:
iterator in interface Iterable<DataCell>
Returns:
- returns an iterator over the keys.
See Also:
Iterable.iterator()

save

public void save(ConfigWO config)
Saves the DataCell to Shape mapping to the given Config.

Specified by:
save in interface ShapeHandler.ShapeModel
Parameters:
config - Save settings to.
Throws:
NullPointerException - If the config is null.

load

public static ShapeModelNominal load(ConfigRO config)
                              throws InvalidSettingsException
Reads Shape settings from given Config and returns a new ShapeModelNominal object.

Parameters:
config - Reads shape model from.
Returns:
A new ShapeModelNominal object.
Throws:
InvalidSettingsException - If the ShapeModel settings could not be read.
NullPointerException - If the config is null.

printShapeMapping

public String printShapeMapping()
Returns:
A String for this ShapeModel as list of DataCell to Shape mapping.

toString

public String toString()
Overrides:
toString in class Object
Returns:
Nominal ShapeModel
See Also:
Object.toString()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


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.