org.knime.core.data
Class DataValue.UtilityFactory

java.lang.Object
  extended by org.knime.core.data.DataValue.UtilityFactory
Direct Known Subclasses:
BitVectorValue.BitVectorUtilityFactory, BitVectorValue.BitVectorUtilityFactory, ByteVectorValue.ByteVectorUtilityFactory, CollectionDataValue.CollectionUtilityFactory, ComplexNumberValue.ComplexNumberUtilityFactory, DateAndTimeUtility, DoubleValue.DoubleUtilityFactory, FuzzyIntervalValue.FuzzyIntervalUtilityFactory, FuzzyNumberValue.FuzzyNumberUtilityFactory, IntervalValue.IntervalUtilityFactory, IntValue.IntUtilityFactory, LongValue.LongUtilityFactory, StringValue.StringUtilityFactory, TimestampValue.TimestampUtilityFactory
Enclosing interface:
DataValue

public static class DataValue.UtilityFactory
extends Object

Implementation of the meta information to a DataValue. DataValue implementations with customized meta information must provide a static final member called UTILTIY of this class.


Constructor Summary
protected DataValue.UtilityFactory()
          Only subclasses are allowed to instantiate this class.
 
Method Summary
protected  DataValueComparator getComparator()
          Derived classes should override this and provide a DataValueComparator that compares the respective DataValue.
 Icon getIcon()
          Get an icon representing this value.
protected  DataValueRendererFamily getRendererFamily(DataColumnSpec spec)
          Returns a family of all renderers this type natively supports.
protected static Icon loadIcon(Class<?> className, String path)
          Convenience method to allow subclasses to load their icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataValue.UtilityFactory

protected DataValue.UtilityFactory()
Only subclasses are allowed to instantiate this class. This constructor does nothing.

Method Detail

getIcon

public Icon getIcon()
Get an icon representing this value. This is used in table headers and lists, for instance.

It is recommended to override this method and return an appropriate icon of size 16x16px.

Returns:
an icon for this value

getRendererFamily

protected DataValueRendererFamily getRendererFamily(DataColumnSpec spec)
Returns a family of all renderers this type natively supports. Derived classes should override this method to provide their own renderer family for the native value class.

Views that rely on renderer implementations will get a list of all available renderers by invoking DataType.getRenderer(DataColumnSpec) on the column's DataType which makes sure that all renderer implementations of compatible values are returned.

Parameters:
spec - the DataColumnSpec of the column for which the renderers are used. Most of the renderer implementations won't need column domain information but some do. For instance a class that renders the double value in the column according to the min/max values in the column domain.
Returns:
null

getComparator

protected DataValueComparator getComparator()
Derived classes should override this and provide a DataValueComparator that compares the respective DataValue. If null is returned the cell implementing the DataValue interface is said to be not comparable with respect to this DataValue interface. If none of the implemented DataValue interfaces is comparable, the fallback comparator based on the cell's toString() method is used.

Returns:
this default implementation returns null

loadIcon

protected static Icon loadIcon(Class<?> className,
                               String path)
Convenience method to allow subclasses to load their icon. The icon is supposed to be located relative to the package associated with the argument class under the path path. This method will not throw an exception when the loading fails but instead return a null icon.

Parameters:
className - The class object, from which to retrieve the package, e.g. FooValue.class.
path - The icon path relative to package associated with the class argument.
Returns:
the icon loaded from that path or null if it loading fails


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.