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,DataSetMetaData,EventSource
public class LabelledMarkerDataSet extends AbstractDataSet<LabelledMarkerDataSet> implements DataSet
Minor extension toDefaultDataSetto easier handle labelled markers.- Author:
- braeun
-
-
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 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 LabelledMarkerDataSet(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelledMarkerDataSetadd(LabelledMarker marker)LabelledMarkerDataSetclearData()protected LabelledMarkerDataSetcomputeLimits()Computes limits (ranges) of this DataSet.java.util.List<DoublePoint>getData()intgetDataCount()Get the number of data points in the data setjava.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.doublegetX(int index)Gets the x value of the data point with the index idoublegetY(int index)Gets the y value of the data point with the index iLabelledMarkerDataSetremove(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, binarySearchX, binarySearchY, fireInvalidated, getDataCount, getDefaultDataLabel, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getThis, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, 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, 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.ArrayList<java.lang.String> dataLabels
-
dataStyles
protected java.util.ArrayList<java.lang.String> dataStyles
-
data
protected java.util.ArrayList<DoublePoint> data
-
-
Method Detail
-
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
-
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- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
clearData
public LabelledMarkerDataSet clearData()
- Returns:
- remove all data points
-
getX
public double getX(int index)
Description copied from interface:DataSetGets the x value of the data point with the index i
-
getY
public double getY(int index)
Description copied from interface:DataSetGets the y value of the data point with the index i
-
add
public LabelledMarkerDataSet add(LabelledMarker marker)
- Parameters:
marker- new marker- 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)
-
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(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)
-
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)
-
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
-
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)
-
computeLimits
protected LabelledMarkerDataSet computeLimits()
Computes limits (ranges) of this DataSet.- Overrides:
computeLimitsin classAbstractDataSet<LabelledMarkerDataSet>- Returns:
- itself (fluent design)
-
-