adams.data.instance
Class InstancePoint

java.lang.Object
  extended by adams.data.container.AbstractDataPoint
      extended by adams.data.instance.InstancePoint
All Implemented Interfaces:
CloneHandler, DataPoint, Serializable, Comparable

public class InstancePoint
extends AbstractDataPoint

A 2-dimensional point (X: attribute index, Y: internal value).

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  Integer m_X
          the X value.
protected  Double m_Y
          the Y value.
 
Fields inherited from class adams.data.container.AbstractDataPoint
m_Parent
 
Constructor Summary
InstancePoint()
          Initializes the point with no points and no ID.
InstancePoint(Integer x, Double y)
          Initializes the point with no ID.
 
Method Summary
 void assign(DataPoint other)
          Obtains the stored variables from the other data point.
 int compareTo(Object o)
          Compares this object with the specified object for order.
 Integer getX()
          Returns the X value.
 Double getY()
          Returns the Y value.
 InstancePoint parse(String s)
          Parses a string and instantiates a sequence point of it.
 void setX(Integer value)
          Sets the X value.
 void setY(Double value)
          Sets the Y value.
 String toString()
          Returns a string representation of the point.
 
Methods inherited from class adams.data.container.AbstractDataPoint
equals, getClone, getParent, hasParent, setParent, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_X

protected Integer m_X
the X value.


m_Y

protected Double m_Y
the Y value.

Constructor Detail

InstancePoint

public InstancePoint()
Initializes the point with no points and no ID.


InstancePoint

public InstancePoint(Integer x,
                     Double y)
Initializes the point with no ID.

Parameters:
x - the X value
y - the Y value
Method Detail

setX

public void setX(Integer value)
Sets the X value.

Parameters:
value - the new X value

getX

public Integer getX()
Returns the X value.

Returns:
the X value

setY

public void setY(Double value)
Sets the Y value.

Parameters:
value - the new Y value

getY

public Double getY()
Returns the Y value.

Returns:
the Y value

compareTo

public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable
Specified by:
compareTo in class AbstractDataPoint
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this object.

assign

public void assign(DataPoint other)
Obtains the stored variables from the other data point.

Specified by:
assign in interface DataPoint
Overrides:
assign in class AbstractDataPoint
Parameters:
other - the data point to get the values from

parse

public InstancePoint parse(String s)
Parses a string and instantiates a sequence point of it.

Parameters:
s - the string to parse
Returns:
the instantiated point, null in case of an error

toString

public String toString()
Returns a string representation of the point.

Specified by:
toString in class AbstractDataPoint
Returns:
the string representation


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.