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,DataSet3D,DataSetMetaData,EventSource
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
-
-
Field Summary
-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet3D
zRange
-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
dataLabels, dataStyles, editConstraints, lock, metaInfoMap, name, updateListeners, xRange, yRange
-
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 fashionjava.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.doublegetX(int i)Gets the x value of the data point with the index iintgetXDataCount()Returns number of X coordinates.doublegetY(int i)Gets the y value of the data point with the index iintgetYDataCount()Returns number of Y coordinates.doublegetZ(int xIndex, int yIndex)Returns Z coordinate for the specified data point.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)Changes a data point at specified index to new values.voidsetX(int xIndex, double x)voidsetY(int yIndex, double y)-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet3D
computeLimits, getDataCount, getXIndex, getYIndex, getZRange
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, binarySearchX, binarySearchY, fireInvalidated, getDataCount, getDataLabel, getDefaultDataLabel, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getThis, getUndefValue, getWarningList, getXMax, getXMin, getXRange, getYMax, getYMin, getYRange, isAutoNotification, lock, minNeigbourSearchX, removeDataLabel, removeStyle, setAutoNotifaction, setEditConstraints, setName, toString, unlock, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getDataCount, getDataLabel, getName, getStyle, getUndefValue, getValue, getXMax, getXMin, getXValues, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlock
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, removeListener, updateEventListener
-
-
-
-
Constructor Detail
-
DoubleDataSet3D
public DoubleDataSet3D(java.lang.String name)
- Parameters:
name- of data set
-
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)
-
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, 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
-
-
Method Detail
-
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
-
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
-
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
-
clearData
public DoubleDataSet3D clearData()
clears all data points- Returns:
- itself (fluent design)
-
set
public void set(int xIndex, int yIndex, double x, double y, double z)Description copied from interface:DataSet3DChanges a data point at specified index to new values.- Parameters:
xIndex- the x-axis coordinate index of the data point to be changedyIndex- the y-axis coordinate index of the data point to be changedx- X coordinatey- Y coordinatez- value on the z-axis
-
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
-
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
-
getXDataCount
public int getXDataCount()
Description copied from interface:DataSet3DReturns number of X coordinates.- Returns:
- the number of y axis bins
-
getYDataCount
public int getYDataCount()
Description copied from interface:DataSet3DReturns number of Y coordinates.- Returns:
- the number of y axis bins
-
getX
public double getX(int i)
Description copied from interface:DataSetGets the x value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the x value
-
getY
public double getY(int i)
Description copied from interface:DataSetGets the y value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the y value
-
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)
-
-