public class ComparableObjectItem
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable, java.io.Serializable
ComparableObjectSeries.| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
obj
The y-value.
|
private static long |
serialVersionUID
For serialization.
|
private java.lang.Comparable |
x
The x-value.
|
| Constructor and Description |
|---|
ComparableObjectItem(java.lang.Comparable x,
java.lang.Object y)
Constructs a new data item.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of this object.
|
int |
compareTo(java.lang.Object o1)
Returns an integer indicating the order of this object relative to
another object.
|
boolean |
equals(java.lang.Object obj)
Tests if this object is equal to another.
|
protected java.lang.Comparable |
getComparable()
Returns the x-value.
|
protected java.lang.Object |
getObject()
Returns the y-value.
|
int |
hashCode()
Returns a hash code.
|
protected void |
setObject(java.lang.Object y)
Sets the y-value for this data item.
|
private static final long serialVersionUID
private java.lang.Comparable x
private java.lang.Object obj
public ComparableObjectItem(java.lang.Comparable x,
java.lang.Object y)
x - the x-value (null NOT permitted).y - the y-value (null permitted).protected java.lang.Comparable getComparable()
null).protected java.lang.Object getObject()
null).protected void setObject(java.lang.Object y)
y - the new y-value (null permitted).public int compareTo(java.lang.Object o1)
For the order we consider only the x-value: negative == "less-than", zero == "equal", positive == "greater-than".
compareTo in interface java.lang.Comparableo1 - the object being compared to.public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - not thrown by this class, but
subclasses may differ.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to test against for equality (null
permitted).public int hashCode()
hashCode in class java.lang.Object