- java.lang.Object
-
- org.jfree.data.ComparableObjectItem
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<ComparableObjectItem>
- Direct Known Subclasses:
OHLCItem,VectorDataItem,XIntervalDataItem,XYIntervalDataItem,YIntervalDataItem
public class ComparableObjectItem extends Object implements Comparable<ComparableObjectItem>, Cloneable, Serializable
Represents one (Comparable, Object) data item for use in aComparableObjectSeries.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComparableObjectItem(Comparable x, Object y)Constructs a new data item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of this object.intcompareTo(ComparableObjectItem other)Returns an integer indicating the order of this object relative to another object.booleanequals(Object obj)Tests if this object is equal to another.protected ComparablegetComparable()Returns the x-value.protected ObjectgetObject()Returns the y-value.inthashCode()Returns a hash code.protected voidsetObject(Object y)Sets the y-value for this data item.
-
-
-
Constructor Detail
-
ComparableObjectItem
public ComparableObjectItem(Comparable x, Object y)
Constructs a new data item.- Parameters:
x- the x-value (nullNOT permitted).y- the y-value (nullpermitted).
-
-
Method Detail
-
getComparable
protected Comparable getComparable()
Returns the x-value.- Returns:
- The x-value (never
null).
-
setObject
protected void setObject(Object y)
Sets the y-value for this data item. Note that there is no corresponding method to change the x-value.- Parameters:
y- the new y-value (nullpermitted).
-
compareTo
public int compareTo(ComparableObjectItem other)
Returns an integer indicating the order of this object relative to another object.For the order we consider only the x-value: negative == "less-than", zero == "equal", positive == "greater-than".
- Specified by:
compareToin interfaceComparable<ComparableObjectItem>- Parameters:
other- the object being compared to.- Returns:
- An integer indicating the order of this data pair object relative to another object.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this object.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- not thrown by this class, but subclasses may differ.
-
-