org.chenillekit.tapestry.core.utils
Class XYDataItem

java.lang.Object
  extended by org.chenillekit.tapestry.core.utils.XYDataItem
All Implemented Interfaces:
Serializable, Comparable

public class XYDataItem
extends Object
implements Serializable, Comparable

Version:
$Id: XYDataItem.java 670 2010-07-19 09:22:02Z mlusetti $
See Also:
Serialized Form

Constructor Summary
XYDataItem(Number xValue, Number yValue)
          Constructs a new data item.
 
Method Summary
 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.
 Number getXValue()
          Returns the x-value.
 Number getYValue()
          Returns the y-value.
 int hashCode()
          Returns a hash code.
 void setXValue(Number xValue)
          Sets the x-value for this data item.
 void setYValue(Number yValue)
          Sets the y-value for this data item.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XYDataItem

public XYDataItem(Number xValue,
                  Number yValue)
Constructs a new data item.

Parameters:
xValue - the x-value.
yValue - the y-value.
Method Detail

getXValue

public Number getXValue()
Returns the x-value.

Returns:
The x-value.

getYValue

public Number getYValue()
Returns the y-value.

Returns:
The y-value.

setYValue

public void setYValue(Number yValue)
Sets the y-value for this data item.

Parameters:
yValue - the new y-value.

setXValue

public void setXValue(Number xValue)
Sets the x-value for this data item.

Parameters:
xValue - the new x-value.

equals

public boolean equals(Object obj)
Tests if this object is equal to another.

Overrides:
equals in class Object
Parameters:
obj - the object to test against for equality (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class Object
Returns:
A hash code.

compareTo

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

Specified by:
compareTo in interface Comparable
Parameters:
o1 - the object being compared to.
Returns:
An integer indicating the order of this data pair object relative to another object.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2011 ChenilleKit. All Rights Reserved.