org.knime.core.data.def
Class IntervalCell

java.lang.Object
  extended by org.knime.core.data.DataCell
      extended by org.knime.core.data.def.IntervalCell
All Implemented Interfaces:
Serializable, DataValue, FuzzyIntervalValue, IntervalValue

public final class IntervalCell
extends DataCell
implements FuzzyIntervalValue, IntervalValue

A DataCell implementation holding a numeric interval as value by storing left and right bound.

Author:
Thomas Gabriel, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.data.FuzzyIntervalValue
FuzzyIntervalValue.FuzzyIntervalUtilityFactory
 
Nested classes/interfaces inherited from interface org.knime.core.data.IntervalValue
IntervalValue.IntervalUtilityFactory
 
Nested classes/interfaces inherited from interface org.knime.core.data.DataValue
DataValue.UtilityFactory
 
Field Summary
static DataType TYPE
          Convenience access member for DataType.getType(IntervalCell.class).
 
Fields inherited from interface org.knime.core.data.FuzzyIntervalValue
UTILITY
 
Fields inherited from interface org.knime.core.data.IntervalValue
UTILITY
 
Constructor Summary
IntervalCell(double left, double right)
          Creates a new interval cell based on the minimum and maximum value, while both bounds are included.
IntervalCell(double left, double right, boolean includeLeft, boolean includeRight)
          Creates a new interval cell based on the minimum and maximum value.
 
Method Summary
 int compare(double value)
          Determines if the given double value is contained in this interval, to the left or to the right.
 int compare(DoubleValue value)
          Determines if the given double value is contained in this interval, to the left or to the right.
protected  boolean equalsDataCell(DataCell dc)
          Checks if this and the given cell have equal values.
static org.knime.core.data.def.IntervalCell.IntervalSerializer getCellSerializer()
          Returns the factory to read/write DataCells of this class from/to a DataInput/DataOutput.
 double getCenterOfGravity()
          Returns the mean of minimum and maximum border.
 double getLeftBound()
          
 double getMaxCore()
           
 double getMaxSupport()
           
 double getMinCore()
           
 double getMinSupport()
           
static Class<? extends DataValue> getPreferredValueClass()
          Returns the preferred value class of this cell implementation.
 double getRightBound()
          
 int hashCode()
          Computes hash code based on all private members.
 boolean includes(IntervalValue value)
          Determines if the given IntervalValue is contained in this interval.
 boolean leftBoundIncluded()
          
 boolean rightBoundIncluded()
          
 String toString()
          Return a string summary of this object.
 
Methods inherited from class org.knime.core.data.DataCell
equals, getType, isMissing
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final DataType TYPE
Convenience access member for DataType.getType(IntervalCell.class).

See Also:
DataType.getType(Class)
Constructor Detail

IntervalCell

public IntervalCell(double left,
                    double right,
                    boolean includeLeft,
                    boolean includeRight)
Creates a new interval cell based on the minimum and maximum value.

Parameters:
left - bound
right - bound
includeLeft - whether the left bound is included
includeRight - whether the right bound is included
Throws:
IllegalArgumentException - if min > max

IntervalCell

public IntervalCell(double left,
                    double right)
Creates a new interval cell based on the minimum and maximum value, while both bounds are included.

Parameters:
left - bound
right - bound
Throws:
IllegalArgumentException - if min > max
Method Detail

getPreferredValueClass

public static final Class<? extends DataValue> getPreferredValueClass()
Returns the preferred value class of this cell implementation. This method is called per reflection to determine which is the preferred renderer, comparator, etc.

Returns:
IntervalValue.class

getCellSerializer

public static final org.knime.core.data.def.IntervalCell.IntervalSerializer getCellSerializer()
Returns the factory to read/write DataCells of this class from/to a DataInput/DataOutput. This method is called via reflection.

Returns:
a serializer for reading/writing cells of this kind

getMinSupport

public double getMinSupport()
Specified by:
getMinSupport in interface FuzzyIntervalValue
Returns:
Minimum support value.

getMinCore

public double getMinCore()
Specified by:
getMinCore in interface FuzzyIntervalValue
Returns:
Minimum core value.

getMaxCore

public double getMaxCore()
Specified by:
getMaxCore in interface FuzzyIntervalValue
Returns:
Maximum core value.

getMaxSupport

public double getMaxSupport()
Specified by:
getMaxSupport in interface FuzzyIntervalValue
Returns:
Maximum support value.

getCenterOfGravity

public double getCenterOfGravity()
Returns the mean of minimum and maximum border.

Specified by:
getCenterOfGravity in interface FuzzyIntervalValue
Returns:
the mean of both value

equalsDataCell

protected boolean equalsDataCell(DataCell dc)
Checks if this and the given cell have equal values.

Specified by:
equalsDataCell in class DataCell
Parameters:
dc - the other IntervalCell to check values
Returns:
true if both, minimum and maximum border have equal values, otherwise false
See Also:
#equalsDataCell(org.knime.core.data.DataCell)

hashCode

public int hashCode()
Computes hash code based on all private members. This method must be implemented in order to ensure that two equal DataCell objects return the same hash code.

Specified by:
hashCode in class DataCell
Returns:
the hash code of your specific DataCell
See Also:
Object.hashCode(), DataCell.equals(java.lang.Object)

toString

public String toString()
Return a string summary of this object.

Specified by:
toString in class DataCell
Returns:
[left,right] string
See Also:
Object.toString()

getRightBound

public double getRightBound()

Specified by:
getRightBound in interface IntervalValue
Returns:
maximum border

getLeftBound

public double getLeftBound()

Specified by:
getLeftBound in interface IntervalValue
Returns:
minimum border

compare

public int compare(double value)
Determines if the given double value is contained in this interval, to the left or to the right.

Specified by:
compare in interface IntervalValue
Parameters:
value - the value to check
Returns:
-1 if value is left to the interval, 0 if it is included an 1 if it is to the right of the interval

compare

public int compare(DoubleValue value)
Determines if the given double value is contained in this interval, to the left or to the right.

Specified by:
compare in interface IntervalValue
Parameters:
value - the value to check
Returns:
-1 if value is left to the interval, 0 if it is included an 1 if it is to the right of the interval

includes

public boolean includes(IntervalValue value)
Determines if the given IntervalValue is contained in this interval.

Specified by:
includes in interface IntervalValue
Parameters:
value - the interval to check
Returns:
true if the value is completely contained in the interval

leftBoundIncluded

public boolean leftBoundIncluded()

Specified by:
leftBoundIncluded in interface IntervalValue
Returns:
whether the left bound is included in the interval

rightBoundIncluded

public boolean rightBoundIncluded()

Specified by:
rightBoundIncluded in interface IntervalValue
Returns:
whether the right bound is included in the interval


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.