Package de.gsi.dataset.spi
Class ListDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<ListDataSet>
-
- de.gsi.dataset.spi.ListDataSet
-
- All Implemented Interfaces:
DataSet,DataSetMetaData,EventSource
public class ListDataSet extends AbstractDataSet<ListDataSet> implements DataSet
Deprecated.due to poorer CPU performance (this is kept for reference reasons)Implementation of theDataSetinterface which keeps the x,y values in an observable list. It provides methods allowing easily manipulate of data points.
User provides X and Y coordinates or only Y coordinates. In the former case X coordinates have value of data point index. N.B. this is a classic list-based implementation. This is a "simple" implementation but has a poorer performance compared to Default- and Double-based DataSets @see DoubleDataSet- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<DoublePoint>dataDeprecated.protected java.util.Map<java.lang.Integer,java.lang.String>dataLabelsDeprecated.protected java.util.Map<java.lang.Integer,java.lang.String>dataStylesDeprecated.-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
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 ListDataSet(java.lang.String name)Deprecated.Creates a new instance ofCustomDataSet.ListDataSet(java.lang.String name, double[] yValues)Deprecated.Creates a new instance ofCustomDataSet.ListDataSet(java.lang.String name, double[] xValues, double[] yValues)Deprecated.Creates a new instance ofCustomDataSet.ListDataSet(java.lang.String name, java.util.List<DoublePoint> values)Deprecated.Creates a new instance ofCustomDataSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ListDataSetadd(double[] xValues, double[] yValues)Deprecated.Initialises the data set with specified data.ListDataSetadd(double x, double y)Deprecated.Add point to the DoublePoints objectjava.lang.StringaddDataLabel(int index, java.lang.String label)Deprecated.adds a custom new data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.java.lang.StringaddDataStyle(int index, java.lang.String style)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.ListDataSetclearData()Deprecated.clear all data pointsjava.util.List<DoublePoint>getData()Deprecated.intgetDataCount()Deprecated.Get the number of data points in the data setjava.lang.StringgetDataLabel(int index)Deprecated.Returns label of a data point specified by the index.java.util.Map<java.lang.Integer,java.lang.String>getDataLabelMap()Deprecated.java.util.Map<java.lang.Integer,java.lang.String>getDataStyleMap()Deprecated.java.lang.StringgetStyle(int index)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.doublegetX(int index)Deprecated.Gets the x value of the data point with the index idoublegetY(int index)Deprecated.Gets the y value of the data point with the index iListDataSetremove(int[] indices)Deprecated.Removes from this data set points with specified indices.ListDataSetremove(int fromIndex, int toIndex)Deprecated.remvove sub-range of data pointsjava.lang.StringremoveDataLabel(int index)Deprecated.remove a custom data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.java.lang.StringremoveStyle(int index)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.ListDataSetset(int index, double x, double y)Deprecated.sets new value of existing data pointListDataSetset(java.util.List<DoublePoint> values)Deprecated.replaces values of all existing data points-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
binarySearchX, binarySearchY, computeLimits, fireInvalidated, getDataCount, getDefaultDataLabel, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getThis, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, lock, minNeigbourSearchX, 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, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getXValues, getYIndex, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlock
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, removeListener, updateEventListener
-
-
-
-
Field Detail
-
dataLabels
protected java.util.Map<java.lang.Integer,java.lang.String> dataLabels
Deprecated.
-
dataStyles
protected java.util.Map<java.lang.Integer,java.lang.String> dataStyles
Deprecated.
-
data
protected java.util.ArrayList<DoublePoint> data
Deprecated.
-
-
Constructor Detail
-
ListDataSet
public ListDataSet(java.lang.String name)
Deprecated.Creates a new instance ofCustomDataSet.- Parameters:
name- name of this DataSet.- Throws:
java.lang.IllegalArgumentException- ifnameisnull
-
ListDataSet
public ListDataSet(java.lang.String name, double[] yValues)Deprecated.Creates a new instance ofCustomDataSet. X coordinates are equal to data points indices.
Note: The provided array is not copied (data set operates on the specified array object) thus the array should not be modified outside of this data set.- Parameters:
name- name of this data set.yValues- Y coordinates- Throws:
java.lang.IllegalArgumentException- if any of parameters isnull
-
ListDataSet
public ListDataSet(java.lang.String name, double[] xValues, double[] yValues)Deprecated.Creates a new instance of
Note: The provided arrays are not copied (data set operates on specified array objects) thus these array should not be modified outside of this data set.CustomDataSet.- Parameters:
name- name of this data set.xValues- X coordinatesyValues- Y coordinates- Throws:
java.lang.IllegalArgumentException- if any of parameters isnullor if arrays with coordinates have different lengths
-
ListDataSet
public ListDataSet(java.lang.String name, java.util.List<DoublePoint> values)Deprecated.Creates a new instance of
CustomDataSet.- Parameters:
name- name of this data set.values- list of data points to set- Throws:
java.lang.IllegalArgumentException- if any of parameters isnullor if arrays with coordinates have different lengths
-
-
Method Detail
-
getDataLabelMap
public java.util.Map<java.lang.Integer,java.lang.String> getDataLabelMap()
Deprecated.- Returns:
- data label map for given data point
-
getDataStyleMap
public java.util.Map<java.lang.Integer,java.lang.String> getDataStyleMap()
Deprecated.- Returns:
- data style map (CSS-styling)
-
getData
public java.util.List<DoublePoint> getData()
Deprecated.- Returns:
- list containing data point definition
-
getDataCount
public int getDataCount()
Deprecated.Description copied from interface:DataSetGet the number of data points in the data set- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
clearData
public ListDataSet clearData()
Deprecated.clear all data points- Returns:
- itself (fluent design)
-
getX
public double getX(int index)
Deprecated.Description copied from interface:DataSetGets the x value of the data point with the index i
-
getY
public double getY(int index)
Deprecated.Description copied from interface:DataSetGets the y value of the data point with the index i
-
set
public ListDataSet set(java.util.List<DoublePoint> values)
Deprecated.replaces values of all existing data points- Parameters:
values- new data points- Returns:
- itself (fluent design)
-
set
public ListDataSet set(int index, double x, double y)
Deprecated.sets new value of existing data point- Parameters:
index- data point indexx- new horizontal valuey- new vertical value- Returns:
- itself (fluent design)
-
add
public ListDataSet add(double x, double y)
Deprecated.Add point to the DoublePoints object- Parameters:
x- coordinatey- coordinate- Returns:
- itself
-
remove
public ListDataSet remove(int fromIndex, int toIndex)
Deprecated.remvove sub-range of data points- Parameters:
fromIndex- start indextoIndex- stop index- Returns:
- itself (fluent design)
-
remove
public ListDataSet remove(int[] indices)
Deprecated.Removes from this data set points with specified indices.- Parameters:
indices- array of indices to be removed- Returns:
- itself
-
add
public ListDataSet add(double[] xValues, double[] yValues)
Deprecated.Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xValues- X coordinatesyValues- Y coordinates- Returns:
- itself
-
addDataLabel
public java.lang.String addDataLabel(int index, java.lang.String label)Deprecated.adds a custom new data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Overrides:
addDataLabelin classAbstractDataSet<ListDataSet>- Parameters:
index- of the data pointlabel- for the data point specified by the index- Returns:
- the previously set label or
nullif no label has been specified
-
removeDataLabel
public java.lang.String removeDataLabel(int index)
Deprecated.remove a custom data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Overrides:
removeDataLabelin classAbstractDataSet<ListDataSet>- Parameters:
index- of the data point- Returns:
- the previously set label or
nullif no label has been specified
-
getDataLabel
public java.lang.String getDataLabel(int index)
Deprecated.Returns 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- Overrides:
getDataLabelin classAbstractDataSet<ListDataSet>- Parameters:
index- of the data label- Returns:
- data point label specified by the index or
nullif no label has been specified
-
addDataStyle
public java.lang.String addDataStyle(int index, java.lang.String style)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
addDataStylein classAbstractDataSet<ListDataSet>- Parameters:
index- the index of the specific data pointstyle- for the given data point (CSS-styling)- Returns:
- itself (fluent interface)
-
removeStyle
public java.lang.String removeStyle(int index)
Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
removeStylein classAbstractDataSet<ListDataSet>- Parameters:
index- the index of the specific data point- Returns:
- itself (fluent interface)
-
getStyle
public java.lang.String getStyle(int index)
Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<ListDataSet>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
-