Class InstancePoint

  • All Implemented Interfaces:
    adams.core.CloneHandler, adams.data.container.DataPoint, Serializable, Comparable

    public class InstancePoint
    extends adams.data.container.AbstractDataPoint
    A 2-dimensional point (X: attribute index, Y: internal value).
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Integer m_X
      the X value.
      protected Double m_Y
      the Y value.
      • Fields inherited from class adams.data.container.AbstractDataPoint

        m_Parent
    • 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 adams.data.container.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​(adams.data.container.DataPoint other)
        Obtains the stored variables from the other data point.
        Specified by:
        assign in interface adams.data.container.DataPoint
        Overrides:
        assign in class adams.data.container.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 adams.data.container.AbstractDataPoint
        Returns:
        the string representation