Class HeatmapValue

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

    public class HeatmapValue
    extends Object
    implements adams.data.container.DataPoint
    Wrapper class for a value in a heatmap.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Heatmap m_Parent
      the parent.
      protected double m_Value
      the heatmap value.
      protected int m_X
      the X position in the heatmap.
      protected int m_Y
      the Y position in the heatmap.
    • Constructor Summary

      Constructors 
      Constructor Description
      HeatmapValue()
      Initializes the heatmap value with 0.0 and coordinates of 0,0.
      HeatmapValue​(int y, int x, double value)
      Initializes the heatmap value.
    • Field Detail

      • m_Parent

        protected Heatmap m_Parent
        the parent.
      • m_Value

        protected double m_Value
        the heatmap value.
      • m_X

        protected int m_X
        the X position in the heatmap.
      • m_Y

        protected int m_Y
        the Y position in the heatmap.
    • Constructor Detail

      • HeatmapValue

        public HeatmapValue()
        Initializes the heatmap value with 0.0 and coordinates of 0,0.
      • HeatmapValue

        public HeatmapValue​(int y,
                            int x,
                            double value)
        Initializes the heatmap value.
        Parameters:
        y - the Y position in the map
        x - the X position in the map
        value - the heatmap value
    • Method Detail

      • setParent

        public void setParent​(adams.data.container.DataContainer value)
        Sets the heatmap this point belongs to.
        Specified by:
        setParent in interface adams.data.container.DataPoint
        Parameters:
        value - the heatmap
      • getParent

        public Heatmap getParent()
        Returns the heatmap this point belongs to.
        Specified by:
        getParent in interface adams.data.container.DataPoint
        Returns:
        the heatmap, can be null
      • hasParent

        public boolean hasParent()
        Returns whether the point belongs to a heatmap.
        Specified by:
        hasParent in interface adams.data.container.DataPoint
        Returns:
        true if the point belongs to a heatmap
      • getX

        public int getX()
        Returns the X position in the map.
        Returns:
        the X position
      • getY

        public int getY()
        Returns the Y position in the map.
        Returns:
        the Y position
      • getValue

        public double getValue()
        Returns the value in the heatmap.
        Returns:
        the value
      • isMissingValue

        public boolean isMissingValue()
        Returns whether the value represents a missing value.
        Returns:
        true if missing value
      • 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
        Parameters:
        other - the data point to get the values from
      • 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
        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.
      • getClone

        public Object getClone()
        Returns a clone of itself. Parent gets set to null!
        Specified by:
        getClone in interface adams.core.CloneHandler
        Specified by:
        getClone in interface adams.data.container.DataPoint
        Returns:
        the clone
      • toString

        public String toString()
        Returns a string representation of the value.
        Overrides:
        toString in class Object
        Returns:
        a string representation