adams.data.heatmap
Class HeatmapValue

java.lang.Object
  extended by adams.data.heatmap.HeatmapValue
All Implemented Interfaces:
CloneHandler, DataPoint, Serializable, Comparable

public class HeatmapValue
extends Object
implements DataPoint

Wrapper class for a value in a heatmap.

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

Field Summary
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
HeatmapValue()
          Initializes the heatmap value with 0.0 and coordinates of 0,0.
HeatmapValue(int y, int x, double value)
          Initializes the heatmap value.
 
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.
 Object getClone()
          Returns a clone of itself.
 Heatmap getParent()
          Returns the heatmap this point belongs to.
 double getValue()
          Returns the value in the heatmap.
 int getX()
          Returns the X position in the map.
 int getY()
          Returns the Y position in the map.
 boolean hasParent()
          Returns whether the point belongs to a heatmap.
 void setParent(DataContainer value)
          Sets the heatmap this point belongs to.
 String toString()
          Returns a string representation of the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(DataContainer value)
Sets the heatmap this point belongs to.

Specified by:
setParent in interface DataPoint
Parameters:
value - the heatmap

getParent

public Heatmap getParent()
Returns the heatmap this point belongs to.

Specified by:
getParent in interface DataPoint
Returns:
the heatmap, can be null

hasParent

public boolean hasParent()
Returns whether the point belongs to a heatmap.

Specified by:
hasParent in interface 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

assign

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

Specified by:
assign in interface 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 CloneHandler
Specified by:
getClone in interface DataPoint
Returns:
the clone

toString

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

Overrides:
toString in class Object
Returns:
a string representation


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