Package de.gsi.dataset.spi
Class LabelledMarkerDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<LabelledMarkerDataSet>
-
- de.gsi.dataset.spi.LabelledMarkerDataSet
-
- All Implemented Interfaces:
DataSet,DataSet2D,DataSetMetaData,EventSource,java.io.Serializable
public class LabelledMarkerDataSet extends AbstractDataSet<LabelledMarkerDataSet> implements DataSet2D
Minor extension toDefaultDataSetto easier handle labelled markers.- Author:
- braeun
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<DoublePoint>dataprotected java.util.ArrayList<java.lang.String>dataLabelsprotected java.util.ArrayList<java.lang.String>dataStyles-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description LabelledMarkerDataSet(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelledMarkerDataSetadd(LabelledMarker marker)LabelledMarkerDataSetclearData()doubleget(int dimIndex, int index)Gets the x value of the data point with the index ijava.util.List<DoublePoint>getData()intgetDataCount()Get the number of data points in the data set.intgetDataCount(int dimIndex)Get the number of data points in the data set for a specific dimension.java.lang.StringgetDataLabel(int index)Returns label of a data point specified by the index.java.util.List<java.lang.String>getDataLabels()java.util.List<java.lang.String>getDataStyles()java.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.LabelledMarkerDataSetremove(int fromIndex, int toIndex)remove sub-range of data (marker) pointsLabelledMarkerDataSetset(int index, LabelledMarker marker)replaces existing data marker with new marker valueLabelledMarkerDataSetset(LabelledMarker[] markers)replaces existing with new marker valuesLabelledMarkerDataSetset(java.util.List<LabelledMarker> markers)replaces existing with new marker values-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getThis, getWarningList, hashCode, lock, minNeigbourSearchX, recomputeLimits, 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, getIndex, getName, getStyle, getValues, lock, recomputeLimits, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSet2D
getDimension, getValue, getValue, getX, getXIndex, getXValues, getY, getYIndex, getYValues
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Field Detail
-
dataLabels
protected java.util.ArrayList<java.lang.String> dataLabels
-
dataStyles
protected java.util.ArrayList<java.lang.String> dataStyles
-
data
protected java.util.ArrayList<DoublePoint> data
-
-
Method Detail
-
add
public LabelledMarkerDataSet add(LabelledMarker marker)
- Parameters:
marker- new marker- Returns:
- itself (fluent design)
-
clearData
public LabelledMarkerDataSet clearData()
- Returns:
- remove all data points
-
get
public double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
getData
public java.util.List<DoublePoint> getData()
- Returns:
- list containing data point values
-
getDataCount
public int getDataCount()
Description copied from interface:DataSetGet the number of data points in the data set. The default implementation is the number of points in the highest dimension.- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
getDataCount
public int getDataCount(int dimIndex)
Description copied from interface:DataSetGet the number of data points in the data set for a specific dimension.- Specified by:
getDataCountin interfaceDataSet- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')- Returns:
- the number of data points
-
getDataLabel
public java.lang.String getDataLabel(int index)
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<LabelledMarkerDataSet>- Parameters:
index- of the data label- Returns:
- data point label specified by the index or
nullif no label has been specified
-
getDataLabels
public java.util.List<java.lang.String> getDataLabels()
- Returns:
- data point labels
-
getDataStyles
public java.util.List<java.lang.String> getDataStyles()
- Returns:
- data point styles
-
getStyle
public java.lang.String getStyle(int index)
A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<LabelledMarkerDataSet>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
remove
public LabelledMarkerDataSet remove(int fromIndex, int toIndex)
remove sub-range of data (marker) points- Parameters:
fromIndex- start indextoIndex- stop index- Returns:
- itself (fluent design)
-
set
public LabelledMarkerDataSet set(int index, LabelledMarker marker)
replaces existing data marker with new marker value- Parameters:
index- index of existing pointmarker- new marker value- Returns:
- itself (fluent design)
-
set
public LabelledMarkerDataSet set(LabelledMarker[] markers)
replaces existing with new marker values- Parameters:
markers- new marker values- Returns:
- itself (fluent design)
-
set
public LabelledMarkerDataSet set(java.util.List<LabelledMarker> markers)
replaces existing with new marker values- Parameters:
markers- new marker values- Returns:
- itself (fluent design)
-
-