public class DefaultHeatMapDataset extends AbstractDataset implements HeatMapDataset, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
HeatMapDataset interface.| Modifier and Type | Field and Description |
|---|---|
private double |
maxX
The maximum x-value in the dataset.
|
private double |
maxY
The maximum y-value in the dataset.
|
private double |
minX
The minimum x-value in the dataset.
|
private double |
minY
The minimum y-value in the dataset.
|
private int |
xSamples
The number of samples in this dataset for the x-dimension.
|
private int |
ySamples
The number of samples in this dataset for the y-dimension.
|
private double[][] |
zValues
Storage for the z-values.
|
| Constructor and Description |
|---|
DefaultHeatMapDataset(int xSamples,
int ySamples,
double minX,
double maxX,
double minY,
double maxY)
Creates a new dataset where all the z-values are initially 0.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns an independent copy of this dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.
|
double |
getMaximumXValue()
Returns the highest x-value represented in this dataset.
|
double |
getMaximumYValue()
Returns the highest y-value represented in this dataset.
|
double |
getMinimumXValue()
Returns the lowest x-value represented in this dataset.
|
double |
getMinimumYValue()
Returns the lowest y-value represented in this dataset.
|
int |
getXSampleCount()
Returns the number of x values across the width of the dataset.
|
double |
getXValue(int xIndex)
A convenience method that returns the x-value for the given index.
|
int |
getYSampleCount()
Returns the number of y values (or samples) for the dataset.
|
double |
getYValue(int yIndex)
A convenience method that returns the y-value for the given index.
|
java.lang.Number |
getZ(int xIndex,
int yIndex)
Returns the z-value at the specified sample position in the dataset.
|
double |
getZValue(int xIndex,
int yIndex)
Returns the z-value at the specified sample position in the dataset.
|
void |
setZValue(int xIndex,
int yIndex,
double z)
Updates a z-value in the dataset and sends a
DatasetChangeEvent
to all registered listeners. |
void |
setZValue(int xIndex,
int yIndex,
double z,
boolean notify)
Updates a z-value in the dataset and, if requested, sends a
DatasetChangeEvent to all registered listeners. |
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectprivate int xSamples
private int ySamples
private double minX
private double maxX
private double minY
private double maxY
private double[][] zValues
public DefaultHeatMapDataset(int xSamples,
int ySamples,
double minX,
double maxX,
double minY,
double maxY)
xSamples - the number of x-values.ySamples - the number of y-valuesminX - the minimum x-value in the dataset.maxX - the maximum x-value in the dataset.minY - the minimum y-value in the dataset.maxY - the maximum y-value in the dataset.public int getXSampleCount()
getMinimumXValue() and
getMaximumXValue().getXSampleCount in interface HeatMapDatasetpublic int getYSampleCount()
getMinimumYValue() and
getMaximumYValue().getYSampleCount in interface HeatMapDatasetpublic double getMinimumXValue()
getMinimumXValue in interface HeatMapDatasetpublic double getMaximumXValue()
getMaximumXValue in interface HeatMapDatasetpublic double getMinimumYValue()
getMinimumYValue in interface HeatMapDatasetpublic double getMaximumYValue()
getMaximumYValue in interface HeatMapDatasetpublic double getXValue(int xIndex)
getXValue in interface HeatMapDatasetxIndex - the xIndex.public double getYValue(int yIndex)
getYValue in interface HeatMapDatasetyIndex - the yIndex.public double getZValue(int xIndex,
int yIndex)
getZValue in interface HeatMapDatasetxIndex - the position of the x sample in the dataset.yIndex - the position of the y sample in the dataset.public java.lang.Number getZ(int xIndex,
int yIndex)
getZValue(int, int) instead.getZ in interface HeatMapDatasetxIndex - the position of the x sample in the dataset.yIndex - the position of the y sample in the dataset.public void setZValue(int xIndex,
int yIndex,
double z)
DatasetChangeEvent
to all registered listeners.xIndex - the x-index.yIndex - the y-index.z - the new z-value.public void setZValue(int xIndex,
int yIndex,
double z,
boolean notify)
DatasetChangeEvent to all registered listeners.xIndex - the x-index.yIndex - the y-index.z - the new z-value.notify - notify listeners?public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class AbstractDatasetjava.lang.CloneNotSupportedException - if there is a problem
cloning.