public class

ComparableObjectItem

extends Object
implements Serializable Cloneable Comparable<T>
java.lang.Object
   ↳ org.jfree.data.ComparableObjectItem
Known Direct Subclasses

Class Overview

Represents one (Comparable, Object) data item for use in a ComparableObjectSeries.

Summary

Public Constructors
ComparableObjectItem(Comparable x, Object y)
Constructs a new data item.
Public Methods
Object clone()
Returns a clone of this object.
int compareTo(Object o1)
Returns an integer indicating the order of this object relative to another object.
boolean equals(Object obj)
Tests if this object is equal to another.
int hashCode()
Returns a hash code.
Protected Methods
Comparable getComparable()
Returns the x-value.
Object getObject()
Returns the y-value.
void setObject(Object y)
Sets the y-value for this data item.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public ComparableObjectItem (Comparable x, Object y)

Constructs a new data item.

Parameters
x the x-value (null NOT permitted).
y the y-value (null permitted).

Public Methods

public Object clone ()

Returns a clone of this object.

Returns
  • A clone.
Throws
CloneNotSupportedException not thrown by this class, but subclasses may differ.

public int compareTo (Object o1)

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".

Parameters
o1 the object being compared to.
Returns
  • An integer indicating the order of this data pair object relative to another object.

public boolean equals (Object obj)

Tests if this object is equal to another.

Parameters
obj the object to test against for equality (null permitted).
Returns
  • A boolean.

public int hashCode ()

Returns a hash code.

Returns
  • A hash code.

Protected Methods

protected Comparable getComparable ()

Returns the x-value.

Returns
  • The x-value (never null).

protected Object getObject ()

Returns the y-value.

Returns
  • The y-value (possibly null).

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 (null permitted).