Package de.gsi.dataset.spi
Class DoubleGridDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<AbstractGridDataSet<U>>
-
- de.gsi.dataset.spi.AbstractGridDataSet<DoubleGridDataSet>
-
- de.gsi.dataset.spi.DoubleGridDataSet
-
- All Implemented Interfaces:
DataSet,DataSet3D,DataSetMetaData,EventSource,GridDataSet,java.io.Serializable
public class DoubleGridDataSet extends AbstractGridDataSet<DoubleGridDataSet> implements DataSet3D
Implementation of the GridDataSet. Allows data on n-dimensional Cartesian grids with m values per point. The dimension of the dataSet is n+m.- Author:
- Alexander Krimm
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intdataCountprotected double[][]gridprotected int[]shapeprotected MultiArrayDouble[]values-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
axisListener, dimension
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description DoubleGridDataSet(GridDataSet another)Creates a new instance ofDoubleDataSetas copy of another (deep-copy).DoubleGridDataSet(java.lang.String name, boolean copy, double[][] grid, double[]... vals)DoubleGridDataSet(java.lang.String name, int dims)Creates a new instance ofDoubleDataSet.DoubleGridDataSet(java.lang.String name, int[] shape, boolean copy, double[]... vals)DoubleGridDataSet(java.lang.String name, int nDims, int[] shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearData()doubleget(int dimIndex, int index)Gets the x value of the data point with the index idoubleget(int dimIndex, int... indices)intgetDataCount()Get the number of data points in the data set.doublegetGrid(int dimIndex, int index)Returns the Grid Value along the specified Grid dimensiondouble[]getGridValues(int dimIndex)int[]getShape()intgetShape(int dimIndex)double[]getValues(int dimIndex)voidset(boolean copy, double[][] grid, double[]... vals)GridDataSetset(int dimIndex, int[] indices, double value)Sets a single value on the gridGridDataSetset(DataSet another, boolean copy)-
Methods inherited from class de.gsi.dataset.spi.AbstractGridDataSet
getGridIndex, getValue, recomputeLimits
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, binarySearch, clearMetaInfo, copyAxisDescription, copyDataLabelsAndStyles, copyMetaData, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getThis, getWarningList, hashCode, lock, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getAxisDescriptions, getDataLabel, getDimension, getIndex, getName, getStyle, getStyle, getValue, lock, recomputeLimits, set, setStyle
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
Methods inherited from interface de.gsi.dataset.GridDataSet
getGridIndex, getNGrid
-
-
-
-
Field Detail
-
grid
protected transient double[][] grid
-
values
protected transient MultiArrayDouble[] values
-
shape
protected transient int[] shape
-
dataCount
protected transient int dataCount
-
-
Constructor Detail
-
DoubleGridDataSet
public DoubleGridDataSet(GridDataSet another)
Creates a new instance ofDoubleDataSetas copy of another (deep-copy).- Parameters:
another- dataSet to copy into this dataSet
-
DoubleGridDataSet
public DoubleGridDataSet(java.lang.String name, int dims)Creates a new instance ofDoubleDataSet.- Parameters:
name- name of this DataSet.dims- number of dimensions for the new data set, grid dimension will be dim-1- Throws:
java.lang.IllegalArgumentException- ifnameisnull
-
DoubleGridDataSet
public DoubleGridDataSet(java.lang.String name, int nDims, int[] shape)- Parameters:
name- name for this DataSetnDims- number of Dimensionsshape- Shape of the grid
-
DoubleGridDataSet
public DoubleGridDataSet(java.lang.String name, int[] shape, boolean copy, double[]... vals)- Parameters:
name- name for the dataSetshape- shape of the gridcopy- whether to copy the values in valsvals- values
-
DoubleGridDataSet
public DoubleGridDataSet(java.lang.String name, boolean copy, double[][] grid, double[]... vals)- Parameters:
name- name for the dataSetcopy- whether to copy the values from grid and valsgrid- values for the gridvals- values
-
-
Method Detail
-
get
public double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
getDataCount
public int getDataCount()
Description copied from interface:DataSetGet the number of data points in the data set.- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
getShape
public int[] getShape()
- Specified by:
getShapein interfaceGridDataSet- Returns:
- the shape of the grid of the data, e.g { 3, 4 } for a 3 x 4 matrix.
-
getShape
public int getShape(int dimIndex)
- Specified by:
getShapein interfaceGridDataSet- Parameters:
dimIndex- the dimension to get the grid shape for- Returns:
- the number of grid points in the given dimension
-
getGrid
public double getGrid(int dimIndex, int index)Description copied from interface:GridDataSetReturns the Grid Value along the specified Grid dimension- Specified by:
getGridin interfaceGridDataSet- Parameters:
dimIndex- Dimension Index, smaller than getShape().sizeindex- Index along the specified dimension, smaller than getShape(dimIndex)- Returns:
- the value for the specified index on the grid along the specified dimension
-
getGridValues
public double[] getGridValues(int dimIndex)
- Specified by:
getGridValuesin interfaceGridDataSet- Parameters:
dimIndex- Dimension Index, smaller than getShape().size- Returns:
- A double[getShape(dimIndex)] array containing all the grid values along the specified dimension
-
get
public double get(int dimIndex, int... indices)- Specified by:
getin interfaceGridDataSet- Parameters:
dimIndex- dimension to retrieveindices- indices to retrieve, missing indices are treated as zero- Returns:
- the value for the given indices
-
getValues
public double[] getValues(int dimIndex)
- Specified by:
getValuesin interfaceDataSet- Overrides:
getValuesin classAbstractDataSet<AbstractGridDataSet<DoubleGridDataSet>>- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')- Returns:
- the x value array
-
set
public void set(boolean copy, double[][] grid, double[]... vals)
-
set
public GridDataSet set(DataSet another, boolean copy)
-
set
public GridDataSet set(int dimIndex, int[] indices, double value)
Sets a single value on the grid- Parameters:
dimIndex- Dimension to set value forindices- grid indices to modifyvalue- new Value- Returns:
- itself for method chaining
-
clearData
public void clearData()
-
-