Package org.jfree.data
Class ComparableObjectItem
java.lang.Object
org.jfree.data.ComparableObjectItem
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
- Direct Known Subclasses:
OHLCItem
,VectorDataItem
,XIntervalDataItem
,XYIntervalDataItem
,YIntervalDataItem
Represents one (Comparable, Object) data item for use in a
ComparableObjectSeries
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this object.int
Returns an integer indicating the order of this object relative to another object.boolean
Tests if this object is equal to another.protected Comparable
Returns the x-value.protected Object
Returns the y-value.int
hashCode()
Returns a hash code.protected void
Sets the y-value for this data item.
-
Constructor Details
-
ComparableObjectItem
Constructs a new data item.- Parameters:
x
- the x-value (null
NOT permitted).y
- the y-value (null
permitted).
-
-
Method Details
-
getComparable
Returns the x-value.- Returns:
- The x-value (never
null
).
-
getObject
Returns the y-value.- Returns:
- The y-value (possibly
null
).
-
setObject
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 (null
permitted).
-
compareTo
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:
compareTo
in interfaceComparable
- Parameters:
o1
- the object being compared to.- Returns:
- An integer indicating the order of this data pair object relative to another object.
-
clone
Returns a clone of this object.- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- not thrown by this class, but subclasses may differ.
-
equals
Tests if this object is equal to another. -
hashCode
Returns a hash code.
-