Package de.gsi.dataset.spi
Class TransposedDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.TransposedDataSet
-
- All Implemented Interfaces:
DataSet,EventSource,java.io.Serializable
- Direct Known Subclasses:
TransposedDataSet.TransposedGridDataSet
public class TransposedDataSet extends java.lang.Object implements DataSet
Allows permutation of the axes of an underlying DataSet, for applications like: - transposed display - reduction of multi-dimensional DataSets to lower dimensions To be able to handle different DataSet Interface types, the constructors are private and only accessible via the static class methods, which return the correct sub-type.- Author:
- Alexander Krimm
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTransposedDataSet.TransposedGridDataSet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.atomic.AtomicBooleanautoNotification()Set the automatic notification of invalidation listeners.doubleget(int dimIndex, int index)Gets the x value of the data point with the index iAxisDescriptiongetAxisDescription(int dimIndex)Return the axis description of the i-th axis.java.util.List<AxisDescription>getAxisDescriptions()intgetDataCount()Get the number of data points in the data set.java.lang.StringgetDataLabel(int index)Returns label of a data point specified by the index.intgetDimension()intgetIndex(int dimIndex, double... value)Gets the index of the data point closest to the given 'value' coordinate.java.lang.StringgetName()Gets the name of the data set.int[]getPermutation()java.lang.StringgetStyle()A string representation of the CSS style associated with this specificDataSet.java.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.doublegetValue(int dimIndex, double... x)Returns the value along the 'dimIndex' axis of a point specified by thexcoordinate.double[]getValues(int dimIndex)booleanisTransposed()<D extends DataSet>
DataSetLock<D>lock()static TransposedDataSetpermute(DataSet dataSet, int[] permutation)DataSetrecomputeLimits(int dimension)DataSetset(DataSet other, boolean copy)voidsetPermutation(int[] permutation)DataSetsetStyle(java.lang.String style)A string representation of the CSS style associated with this specificDataSet.voidsetTransposed(boolean transposed)static TransposedDataSettranspose(DataSet dataSet)static TransposedDataSettranspose(DataSet dataSet, boolean transpose)java.util.List<EventListener>updateEventListener()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener
-
-
-
-
Field Detail
-
dataSet
protected final DataSet dataSet
-
nDims
protected final int nDims
-
permutation
protected int[] permutation
-
-
Method Detail
-
autoNotification
public java.util.concurrent.atomic.AtomicBoolean autoNotification()
Description copied from interface:EventSourceSet the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle.truefor automatic notification- Specified by:
autoNotificationin interfaceEventSource- Returns:
- the atomic boolean
-
get
public double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
getAxisDescriptions
public java.util.List<AxisDescription> getAxisDescriptions()
- Specified by:
getAxisDescriptionsin interfaceDataSet- Returns:
- axis descriptions of the primary and secondary axes
-
getAxisDescription
public AxisDescription getAxisDescription(int dimIndex)
Description copied from interface:DataSetReturn the axis description of the i-th axis.- Specified by:
getAxisDescriptionin interfaceDataSet- Parameters:
dimIndex- 0: X-Axis, 1: Y-Axis, ...- Returns:
- Axis Label
-
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
-
getDataLabel
public java.lang.String getDataLabel(int index)
Description copied from interface:DataSetReturns label of a data point specified by the index. The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Specified by:
getDataLabelin interfaceDataSet- Parameters:
index- the data index- Returns:
- label of a data point specified by the index or
nullif none label has been specified for this data point.
-
getDimension
public int getDimension()
- Specified by:
getDimensionin interfaceDataSet- Returns:
- number of dimensions
-
getIndex
public int getIndex(int dimIndex, double... value)Description copied from interface:DataSetGets the index of the data point closest to the given 'value' coordinate. The index returned may be less then zero or larger the the number of data points in the data set, if the x coordinate lies outside the range of the data set.
-
getName
public java.lang.String getName()
Description copied from interface:DataSetGets the name of the data set.
-
getPermutation
public int[] getPermutation()
-
getStyle
public java.lang.String getStyle()
Description copied from interface:DataSetA string representation of the CSS style associated with this specificDataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
-
getStyle
public java.lang.String getStyle(int index)
Description copied from interface:DataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()
-
getValues
public double[] getValues(int dimIndex)
-
isTransposed
public boolean isTransposed()
-
lock
public <D extends DataSet> DataSetLock<D> lock()
- Specified by:
lockin interfaceDataSet- Type Parameters:
D- generics (fluent design)- Returns:
- Read-Write Lock to guard the DataSet
- See Also:
DataSetLock
-
recomputeLimits
public DataSet recomputeLimits(int dimension)
- Specified by:
recomputeLimitsin interfaceDataSet- Parameters:
dimension- the dimension to recompute the range for (-1 for all dimensions)- Returns:
- itself for method chaining
-
setPermutation
public void setPermutation(int[] permutation)
-
setStyle
public DataSet setStyle(java.lang.String style)
Description copied from interface:DataSetA string representation of the CSS style associated with this specificDataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
-
getValue
public double getValue(int dimIndex, double... x)Description copied from interface:DataSetReturns the value along the 'dimIndex' axis of a point specified by thexcoordinate.
-
setTransposed
public void setTransposed(boolean transposed)
-
updateEventListener
public java.util.List<EventListener> updateEventListener()
- Specified by:
updateEventListenerin interfaceEventSource- Returns:
- list containing all update event listener (needs to be provided by implementing class)
-
permute
public static TransposedDataSet permute(DataSet dataSet, int[] permutation)
-
transpose
public static TransposedDataSet transpose(DataSet dataSet)
-
transpose
public static TransposedDataSet transpose(DataSet dataSet, boolean transpose)
-
-