Package adams.data.heatmap
Class HeatmapValue
- java.lang.Object
-
- adams.data.heatmap.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
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(adams.data.container.DataPoint other)Obtains the stored variables from the other data point.intcompareTo(Object o)Compares this object with the specified object for order.ObjectgetClone()Returns a clone of itself.HeatmapgetParent()Returns the heatmap this point belongs to.doublegetValue()Returns the value in the heatmap.intgetX()Returns the X position in the map.intgetY()Returns the Y position in the map.booleanhasParent()Returns whether the point belongs to a heatmap.booleanisMissingValue()Returns whether the value represents a missing value.voidsetParent(adams.data.container.DataContainer value)Sets the heatmap this point belongs to.StringtoString()Returns a string representation of the 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 mapx- the X position in the mapvalue- the heatmap value
-
-
Method Detail
-
setParent
public void setParent(adams.data.container.DataContainer value)
Sets the heatmap this point belongs to.- Specified by:
setParentin interfaceadams.data.container.DataPoint- Parameters:
value- the heatmap
-
getParent
public Heatmap getParent()
Returns the heatmap this point belongs to.- Specified by:
getParentin interfaceadams.data.container.DataPoint- Returns:
- the heatmap, can be null
-
hasParent
public boolean hasParent()
Returns whether the point belongs to a heatmap.- Specified by:
hasParentin interfaceadams.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:
assignin interfaceadams.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:
compareToin interfaceComparable- 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:
getClonein interfaceadams.core.CloneHandler- Specified by:
getClonein interfaceadams.data.container.DataPoint- Returns:
- the clone
-
-