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 voidassign(DataPoint other)Obtains the stored variables from the other data point.intcompareTo(Object o)Compares this object with the specified object for order.IntegergetX()Returns the X value.DoublegetY()Returns the Y value.InstancePointparse(String s)Parses a string and instantiates a sequence point of it.voidsetX(Integer value)Sets the X value.voidsetY(Double value)Sets the Y value.StringtoString()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:
compareToin interfaceComparable- Specified by:
compareToin 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:
assignin interfaceDataPoint- Overrides:
assignin 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:
toStringin classAbstractDataPoint- Returns:
- the string representation
-
-