org.knime.core.data.property
Class SizeHandler

java.lang.Object
  extended by org.knime.core.data.property.SizeHandler
All Implemented Interfaces:
PropertyHandler

public final class SizeHandler
extends Object
implements PropertyHandler

Final SizeHandler implementation which keeps a SizeModel to request size settings from.

Author:
M. Berthold, University of Konstanz

Nested Class Summary
(package private) static interface SizeHandler.SizeModel
          Internal SizeModel used to request sizes by DataCell attribute value.
 
Field Summary
static double DEFAULT_SIZE
          Deprecated. use DEFAULT_SIZE_FACTOR instead
static double DEFAULT_SIZE_FACTOR
          The default size factor in case no SizeHandler exist, which is one, that is no scaling is done.
 
Constructor Summary
SizeHandler(SizeHandler.SizeModel model)
          Creates a new SizeHandler based on the the given SizeModel.
 
Method Summary
 boolean equals(Object obj)
          
 double getSize(DataCell dc)
          Deprecated. use getSizeFactor(DataCell) instead
 double getSizeFactor(DataCell dc)
          Returns the size as a scaling factor (in [1, )).
 int hashCode()
          
static SizeHandler load(ConfigRO config)
          Reads size settings from the given Config and returns a new SizeHandler.
 void save(ConfigWO config)
          Save the SizeModel class and settings to the given Config.
 String toString()
          Returns a string summary of the underlying SizeHandler.SizeModel.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

@Deprecated
public static final double DEFAULT_SIZE
Deprecated. use DEFAULT_SIZE_FACTOR instead
The default size in case no SizeHandler exists.

See Also:
Constant Field Values

DEFAULT_SIZE_FACTOR

public static final double DEFAULT_SIZE_FACTOR
The default size factor in case no SizeHandler exist, which is one, that is no scaling is done.

See Also:
Constant Field Values
Constructor Detail

SizeHandler

public SizeHandler(SizeHandler.SizeModel model)
Creates a new SizeHandler based on the the given SizeModel.

Parameters:
model - The model for sizes.
Throws:
IllegalArgumentException - If the model is null.
Method Detail

getSize

@Deprecated
public double getSize(DataCell dc)
Deprecated. use getSizeFactor(DataCell) instead

Return size (in [0,1], that is percent, as specified by the content of the given DataCell.

Parameters:
dc - Value to be used to compute size.
Returns:
percentage value to base actual size on. -1 if value is illegal.

getSizeFactor

public double getSizeFactor(DataCell dc)
Returns the size as a scaling factor (in [1, )).

Parameters:
dc - value to use to compute size for
Returns:
a double value > 1

save

public void save(ConfigWO config)
Save the SizeModel class and settings to the given Config.

Parameters:
config - To write size settings into.
Throws:
NullPointerException - If the config is null.

load

public static SizeHandler load(ConfigRO config)
                        throws InvalidSettingsException
Reads size settings from the given Config and returns a new SizeHandler.

Parameters:
config - Read size settings from.
Returns:
A new SizeHandler object.
Throws:
InvalidSettingsException - The the size model settings could not be read.
NullPointerException - If the config is null.

toString

public String toString()
Returns a string summary of the underlying SizeHandler.SizeModel.

Overrides:
toString in class Object
Returns:
a string summary

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.