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 void
assign(adams.data.container.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.boolean
isMissingValue()
Returns whether the value represents a missing value.void
setParent(adams.data.container.DataContainer value)
Sets the heatmap this point belongs to.String
toString()
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:
setParent
in interfaceadams.data.container.DataPoint
- Parameters:
value
- the heatmap
-
getParent
public Heatmap getParent()
Returns the heatmap this point belongs to.- Specified by:
getParent
in interfaceadams.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 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:
assign
in 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:
compareTo
in 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:
getClone
in interfaceadams.core.CloneHandler
- Specified by:
getClone
in interfaceadams.data.container.DataPoint
- Returns:
- the clone
-
-