Package org.jfree.data
Class DefaultContourDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.data.AbstractXYZDataset
org.jfree.data.DefaultContourDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,ContourDataset,Dataset,SeriesChangeListener,SeriesDataset,XYDataset,XYZDataset
- Direct Known Subclasses:
NonGridContourDataset
public class DefaultContourDataset extends AbstractXYZDataset implements ContourDataset
A convenience class that provides a default implementation of the
ContourDataset interface.- Author:
- David M. O'Donnell
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DefaultContourDataset()Creates a new dataset, initially empty.DefaultContourDataset(String seriesName, Object[] xData, Object[] yData, Object[] zData)Constructs a new dataset with the given data. -
Method Summary
Modifier and Type Method Description static Object[]formObjectArray(double[] data)Creates an object array from an array of doubles.static Object[][]formObjectArray(double[][] data)Creates an object array from an array of doubles.intgetItemCount(int series)Returns the number of items in the specified series.doublegetMaxZValue()Returns the maximum z-value.doublegetMinZValue()Returns the minimum z-value.doublegetMinZValue(double minX, double minY, double maxX, double maxY)Returns the minimum z-value.intgetSeriesCount()Returns the number of series.StringgetSeriesName(int series)Returns the name of the specified series.int[]getXIndices()Returns the index of the xvalues.NumbergetXValue(int item)Returns an x value.NumbergetXValue(int series, int item)Returns the x value for the specified series and index (zero-based indices).Number[]getXValues()Returns the x values.NumbergetYValue(int series, int item)Returns the y value for the specified series and index (zero-based indices).Number[]getYValues()Returns a Number array containing all y values.NumbergetZValue(int series, int item)Returns the z value for the specified series and index (zero-based indices).RangegetZValueRange(Range x, Range y)Returns the maximum z-value within visible region of plot.Number[]getZValues()Returns a Number array containing all z values.int[]indexX()Returns an int array contain the index into the x values.intindexX(int k)Given index k, returns the column index containing k.intindexY(int k)Given index k, return the row index containing k.intindexZ(int i, int j)Given column and row indices, returns the k index.voidinitialize(Object[] xData, Object[] yData, Object[] zData)Initialises the dataset.booleanisDateAxis(int axisNumber)Returns true if axis are dates.voidsetSeriesNames(String[] seriesNames)Sets the names of the series in the data source.Methods inherited from class org.jfree.data.AbstractXYZDataset
getZMethods inherited from class org.jfree.data.AbstractXYDataset
getX, getYMethods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.XYZDataset
getZ
-
Constructor Details
-
DefaultContourDataset
public DefaultContourDataset()Creates a new dataset, initially empty. -
DefaultContourDataset
Constructs a new dataset with the given data.- Parameters:
seriesName- the series name.xData- the x values.yData- the y values.zData- the z values.
-
-
Method Details
-
initialize
Initialises the dataset.- Parameters:
xData- the x values.yData- the y values.zData- the z values.
-
formObjectArray
Creates an object array from an array of doubles.- Parameters:
data- the data.- Returns:
- An array of
Doubleobjects.
-
formObjectArray
Creates an object array from an array of doubles.- Parameters:
data- the data.- Returns:
- An array of
Doubleobjects.
-
getItemCount
public int getItemCount(int series)Returns the number of items in the specified series.Method provided to satisfy the
XYDatasetinterface implementation.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- must be zero, as this dataset only supports one series.- Returns:
- the item count.
-
getMaxZValue
public double getMaxZValue()Returns the maximum z-value.- Specified by:
getMaxZValuein interfaceContourDataset- Returns:
- The maximum z-value.
-
getMinZValue
public double getMinZValue()Returns the minimum z-value.- Specified by:
getMinZValuein interfaceContourDataset- Returns:
- The minimum z-value.
-
getZValueRange
Returns the maximum z-value within visible region of plot.- Specified by:
getZValueRangein interfaceContourDataset- Parameters:
x- the x range.y- the y range.- Returns:
- The z range.
-
getMinZValue
public double getMinZValue(double minX, double minY, double maxX, double maxY)Returns the minimum z-value.- Parameters:
minX- the minimum x value.minY- the minimum y value.maxX- the maximum x value.maxY- the maximum y value.- Returns:
- the minimum z-value.
-
getSeriesCount
public int getSeriesCount()Returns the number of series.Required by XYDataset interface (this will always return 1)
- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- 1.
-
getSeriesName
Returns the name of the specified series. Method provided to satisfy the XYDataset interface implementation- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
series- must be zero.- Returns:
- the series name.
-
getXIndices
public int[] getXIndices()Returns the index of the xvalues.- Specified by:
getXIndicesin interfaceContourDataset- Returns:
- The x values.
-
getXValues
Returns the x values.- Specified by:
getXValuesin interfaceContourDataset- Returns:
- The x values.
-
getXValue
Returns the x value for the specified series and index (zero-based indices). Required by the XYDataset -
getXValue
Returns an x value.- Parameters:
item- the item index (zero-based).- Returns:
- The X value.
-
getYValues
Returns a Number array containing all y values.- Specified by:
getYValuesin interfaceContourDataset- Returns:
- The Y values.
-
getYValue
Returns the y value for the specified series and index (zero-based indices). Required by the XYDataset -
getZValues
Returns a Number array containing all z values.- Specified by:
getZValuesin interfaceContourDataset- Returns:
- The Z values.
-
getZValue
Returns the z value for the specified series and index (zero-based indices). Required by the XYDataset- Specified by:
getZValuein interfaceXYZDataset- Parameters:
series- the series index (must be zero for this dataset).item- the item index (zero-based).- Returns:
- The Z value.
-
indexX
public int[] indexX()Returns an int array contain the index into the x values.- Specified by:
indexXin interfaceContourDataset- Returns:
- The X values.
-
indexX
public int indexX(int k)Given index k, returns the column index containing k.- Parameters:
k- index of interest.- Returns:
- The column index.
-
indexY
public int indexY(int k)Given index k, return the row index containing k.- Parameters:
k- index of interest.- Returns:
- The row index.
-
indexZ
public int indexZ(int i, int j)Given column and row indices, returns the k index.- Parameters:
i- index of along x-axis.j- index of along y-axis.- Returns:
- The Z index.
-
isDateAxis
public boolean isDateAxis(int axisNumber)Returns true if axis are dates.- Specified by:
isDateAxisin interfaceContourDataset- Parameters:
axisNumber- The axis where 0-x, 1-y, and 2-z.- Returns:
- A boolean.
-
setSeriesNames
Sets the names of the series in the data source.- Parameters:
seriesNames- The names of the series in the data source.
-