Package adams.data.instance
Class InstancePoint
- java.lang.Object
-
- adams.data.container.AbstractDataPoint
-
- 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).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstancePoint()
Initializes the point with no points and no ID.InstancePoint(Integer x, Double y)
Initializes the point with no ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfaceComparable
- Specified by:
compareTo
in classAbstractDataPoint
- 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 interfaceDataPoint
- Overrides:
assign
in classAbstractDataPoint
- 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 classAbstractDataPoint
- Returns:
- the string representation
-
-