D - java generics handling of DataSet for derived classes (needed for
fluent design)public abstract class AbstractDataSet<D extends AbstractStylable<D>> extends AbstractStylable<D> implements DataSet, DataSetMetaData
The abstract implementation of DataSet interface that provides implementation of some methods.
| Modifier and Type | Field and Description |
|---|---|
protected StringHashMapList |
dataLabels |
protected StringHashMapList |
dataStyles |
protected EditConstraints |
editConstraints |
protected ArrayList<String> |
errorList |
protected ArrayList<String> |
infoList |
protected ReentrantLock |
lock |
protected Map<String,String> |
metaInfoMap |
protected String |
name |
protected List<EventListener> |
updateListeners |
protected ArrayList<String> |
warningList |
protected DataRange |
xRange |
protected DataRange |
yRange |
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
AbstractDataSet(String name)
default constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
addDataLabel(int index,
String label)
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.
|
String |
addDataStyle(int index,
String style)
A string representation of the CSS style associated with this specific
DataSet data point. |
protected int |
binarySearchX(double search,
int indexMin,
int indexMax) |
protected int |
binarySearchY(double search,
int indexMin,
int indexMax) |
D |
clearMetaInfo() |
protected D |
computeLimits()
Computes limits (ranges) of this DataSet.
|
D |
fireInvalidated(UpdateEvent event)
Notifies listeners that the data has been invalidated.
|
int |
getDataCount(double xmin,
double xmax)
Gets the number of data points in the range xmin to xmax.
|
String |
getDataLabel(int index)
Returns label of a data point specified by the index.
|
StringHashMapList |
getDataLabelMap() |
StringHashMapList |
getDataStyleMap() |
EditConstraints |
getEditConstraints() |
List<String> |
getErrorList() |
List<String> |
getInfoList() |
Map<String,String> |
getMetaInfo() |
String |
getName()
Gets the name of the data set.
|
String |
getStyle(int index)
A string representation of the CSS style associated with this specific
DataSet data point. |
protected D |
getThis() |
Double |
getUndefValue()
Returns the value for undefined data points.
|
List<String> |
getWarningList() |
int |
getXIndex(double x)
Gets the index of the data point closest to the given x coordinate.
|
double |
getXMax()
Gets the maximum x value of the data set.
|
double |
getXMin()
Gets the minimum x value of the data set.
|
DataRange |
getXRange() |
int |
getYIndex(double y)
Gets the first index of the data point closest to the given y coordinate.
|
double |
getYMax()
Gets the maximum y value of the data set.
|
double |
getYMin()
Gets the minimum y value of the data set.
|
DataRange |
getYRange() |
boolean |
isAutoNotification()
Checks it automatic notification is enabled.
|
D |
lock()
Locks access to the data set.
|
protected int |
minNeigbourSearchX(double search,
int indexMin,
int indexMax) |
String |
removeDataLabel(int index)
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.
|
String |
removeStyle(int index)
A string representation of the CSS style associated with this specific
DataSet data point. |
D |
setAutoNotifaction(boolean flag)
Set the automatic notification of invalidation listeners.
|
D |
setEditConstraints(EditConstraints constraints) |
D |
setName(String name)
Sets the name of data set (meta data)
|
String |
toString() |
D |
unlock()
Unlock the data set.
|
List<EventListener> |
updateEventListener() |
getStyle, setStyleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDataCount, getStyle, getValue, getX, getXValues, getY, getYValues, setStyleaddListener, invokeListener, invokeListener, removeListenerprotected String name
protected final List<EventListener> updateListeners
protected final ReentrantLock lock
protected DataRange xRange
protected DataRange yRange
protected StringHashMapList dataLabels
protected StringHashMapList dataStyles
protected EditConstraints editConstraints
public AbstractDataSet(String name)
name - the default name of the data set (meta data)protected D getThis()
getThis in class AbstractStylable<D extends AbstractStylable<D>>public D setName(String name)
name - the new namepublic String getName()
DataSetpublic D lock()
DataSetpublic List<EventListener> updateEventListener()
updateEventListener in interface EventSourcepublic D setAutoNotifaction(boolean flag)
DataSetsetAutoNotifaction in interface DataSetflag - true for automatic notificationpublic boolean isAutoNotification()
DataSetisAutoNotification in interface DataSetpublic Double getUndefValue()
DataSetgetUndefValue in interface DataSetpublic double getXMin()
public double getXMax()
public double getYMin()
public double getYMax()
public DataRange getXRange()
public DataRange getYRange()
protected D computeLimits()
public int getDataCount(double xmin,
double xmax)
getDataCount in interface DataSetxmin - the lower end of the rangexmax - the upper end of the rangepublic int getXIndex(double x)
public int getYIndex(double y)
protected int binarySearchX(double search,
int indexMin,
int indexMax)
protected int binarySearchY(double search,
int indexMin,
int indexMax)
protected int minNeigbourSearchX(double search,
int indexMin,
int indexMax)
public D fireInvalidated(UpdateEvent event)
event - the change eventpublic StringHashMapList getDataLabelMap()
public StringHashMapList getDataStyleMap()
public String addDataLabel(int index, String label)
index - of the data pointlabel - for the data point specified by the indexnull if no label has
been specifiedpublic String removeDataLabel(int index)
index - of the data pointnull if no label has
been specifiedpublic String getDataLabel(int index)
getDataLabel in interface DataSetindex - of the data labelnull if
no label has been specifiedpublic String addDataStyle(int index, String style)
DataSet data point. @see #getStyle()index - the index of the specific data pointstyle - string for the data point specific CSS-stylingpublic String removeStyle(int index)
DataSet data point. @see #getStyle()index - the index of the specific data pointpublic String getStyle(int index)
DataSet data point. @see #getStyle()public EditConstraints getEditConstraints()
public D setEditConstraints(EditConstraints constraints)
public Map<String,String> getMetaInfo()
getMetaInfo in interface DataSetMetaDatapublic D clearMetaInfo()
public List<String> getInfoList()
getInfoList in interface DataSetMetaDatapublic List<String> getWarningList()
getWarningList in interface DataSetMetaDatapublic List<String> getErrorList()
getErrorList in interface DataSetMetaDataCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.