public abstract class DataCell extends Object implements DataValue, Serializable
Abstract base class of all
DataCells, which acts as a container
for arbitrary values and defines the common abilities all cells must provide,
that is: retrieve the cell type, a string representation of the value,
find out if this cell is missing, and test whether it is equal to another
Subclasses have to implement at least one interface
DataValue. DataCells must be
read-only, i.e. setter methods must not be implemented and
objects returned by any of the get methods must be immutable.
This class implements
Serializable. However, if
you define a custom
DataCell implementation, consider to
implement a factory that takes care of reading and writing a cell to a
DataCellDataOutput source. Ordinary Java
serialization is considerably slower than implementing your own
DataCellSerializer. Register this serializer at the extension point
DataCells may implement several
interfaces but only one is the preferred value class, the order of the implemented interfaces is important.
The first implemented
DataValue interface is taken as the preferred value class. The
associated with this cell implementation will then provide the renderer, icon, and comparator of this preferred
|Constructor and Description|
|Modifier and Type||Method and Description|
This method is called when two cell of different classes but with the same preferred value are compared (e.g.
Implements the equals method which returns
Derived classes implement their specific equals function here.
Returns this cell's
This method must be implemented in order to ensure that two equal
Returns the String representation of this cell's value.
public final DataType getType()
DataType. This method is provided for convenience only, it is a shortcut for
DataType.getType(o.getClass()), where o is the runtime
public final boolean isMissing()
trueif this represents missing cell,
falseotherwise. The default implementation returns
false. If you need a missing cell use the static method
trueif the cell represents a missing value,
public abstract String toString()
public final boolean equals(Object o)
trueonly if both cells are of the same class and
true. For that, this final method calls the type specific
equalsDataCell(DataCell)method, which all derived
DataCells must provide. This method handles the missing value and
nullcases, in all other cases it delegates to the specific method.
protected abstract boolean equalsDataCell(DataCell dc)
nullor a missing value, to be of the same class like this.
dc- the cell to compare this to
trueif this is equal to the argument,
protected boolean equalContent(DataValue otherValue)
otherValue- the other data value
trueif the content of both cells is the same,
public abstract int hashCode()
DataCellobjects return the same hash code. Note that two cells can be equal according to
equalContent(DataValue)so two different cells implementations with the same preferred value must have the same hash code.
KNIME GmbH, Konstanz, Germany
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.