Package de.gsi.dataset.spi
Class DoubleDataSet3D
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<D>
-
- de.gsi.dataset.spi.AbstractDataSet3D<DoubleDataSet3D>
-
- de.gsi.dataset.spi.DoubleDataSet3D
-
- All Implemented Interfaces:
DataSet,DataSet2D,DataSet3D,DataSetMetaData,EventSource,java.io.Serializable
public class DoubleDataSet3D extends AbstractDataSet3D<DoubleDataSet3D>
Implementation of a AbstractDataSet3D backed by arrays. The z-values are stored in a 2-dim array d[row][column] or d[y][x].- Author:
- braeun
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description DoubleDataSet3D(java.lang.String name)DoubleDataSet3D(java.lang.String name, double[][] zValues)DoubleDataSet3D(java.lang.String name, double[] xValues, double[] yValues, double[][] zValues)DoubleDataSet3D(java.lang.String name, int dimX, int dimY)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleDataSet3DclearData()clears all data pointsprotected static voidfillArray(double[] array, int indexStart, int indexStop, double value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashiondoubleget(int dimIndex, int index)Gets the x value of the data point with the index iintgetDataCount(int dimIndex)Get the number of data points in the data setjava.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.double[]getValues(int dimIndex)doublegetX(int i)Gets the x value of the data point with the index idoublegetZ(int xIndex, int yIndex)Returns Z coordinate for the specified data point.double[][]getZValues()voidset(double[] xValues, double[] yValues, double[][] zValues)overwrites/replaces data points with new coordinatesvoidset(int xIndex, int yIndex, double z)voidset(int xIndex, int yIndex, double x, double y, double z)voidsetX(int xIndex, double x)voidsetY(int yIndex, double y)-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet3D
getDataCount, recomputeLimits
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getThis, getWarningList, hashCode, lock, minNeigbourSearchX, 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, getIndex, getName, getStyle, lock, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSet2D
getValue, getValue, getXIndex, getXValues, getY, getYIndex, getYValues
-
Methods inherited from interface de.gsi.dataset.DataSet3D
getDimension
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Constructor Detail
-
DoubleDataSet3D
public DoubleDataSet3D(java.lang.String name)
- Parameters:
name- of data set
-
DoubleDataSet3D
public DoubleDataSet3D(java.lang.String name, double[] xValues, double[] yValues, double[][] zValues)- Parameters:
name- of data setxValues- array containing new X coordinatesyValues- array containing new X coordinateszValues- array containing new X coordinates
-
DoubleDataSet3D
public DoubleDataSet3D(java.lang.String name, double[][] zValues)- Parameters:
name- of data setzValues- array containing new X coordinates
-
DoubleDataSet3D
public DoubleDataSet3D(java.lang.String name, int dimX, int dimY)- Parameters:
name- of data setdimX- horizontal binning dimension (equidistant model)dimY- vertical binning dimension (equidistant model)
-
-
Method Detail
-
clearData
public DoubleDataSet3D clearData()
clears all data points- Returns:
- itself (fluent design)
-
getDataCount
public int getDataCount(int dimIndex)
Description copied from interface:DataSet2DGet the number of data points in the data set- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')- Returns:
- the number of data points
-
getStyle
public java.lang.String getStyle(int index)
Description copied from class:AbstractDataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<DoubleDataSet3D>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
get
public final double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')index- data point index- Returns:
- the x value
-
getX
public double getX(int i)
Description copied from interface:DataSet2DGets the x value of the data point with the index i- Parameters:
i- the data point index- Returns:
- the x value
-
getValues
public double[] getValues(int dimIndex)
- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')- Returns:
- the x value array
-
getZ
public double getZ(int xIndex, int yIndex)Description copied from interface:DataSet3DReturns Z coordinate for the specified data point.- Parameters:
xIndex- index of X coordinateyIndex- index of Y coordinate- Returns:
- Z coordinate
-
getZValues
public double[][] getZValues()
-
set
public void set(double[] xValues, double[] yValues, double[][] zValues)overwrites/replaces data points with new coordinates- Parameters:
xValues- array containing new X coordinatesyValues- array containing new X coordinateszValues- array containing new X coordinates
-
set
public void set(int xIndex, int yIndex, double z)- Parameters:
xIndex- index of the to be modified pointyIndex- index of the to be modified pointz- new Z coordinate
-
set
public void set(int xIndex, int yIndex, double x, double y, double z)
-
setX
public void setX(int xIndex, double x)- Parameters:
xIndex- index of the to be modified pointx- new X coordinate
-
setY
public void setY(int yIndex, double y)- Parameters:
yIndex- index of the to be modified pointy- new Y coordinate
-
fillArray
protected static void fillArray(double[] array, int indexStart, int indexStop, double value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- to be initializedindexStart- the first index to be setindexStop- the last index to be setvalue- the value for each to be set element
-
-