public abstract class AbstractDataProvider extends java.lang.Object implements IDataProvider
IDataProvider
interface.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
chronological |
protected java.util.List<IDataProviderListener> |
listeners |
protected Range |
xDataMinMax |
protected Range |
yDataMinMax |
| Constructor and Description |
|---|
AbstractDataProvider(boolean chronological) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataProviderListener(IDataProviderListener listener)
Add listener
|
protected void |
fireDataChange()
a data change has occured
|
Range |
getDataRange(boolean positiveOnly,
boolean isAxis)
Returns an updated range whenever data changed, for the XAxis or YAxis,
with positive data only or not.
|
Range |
getDataRange(boolean positiveOnly,
boolean isXAxis,
int lowerBound)
Returns an updated range whenever data changed, for the XAxis or YAxis,
with positive data only or not.
|
abstract ISample |
getSample(int index)
Get sample by index
|
abstract int |
getSize()
Total number of samples.
|
Range |
getXDataMinMax()
Get the minimum and maximum xdata.
|
Range |
getXDataMinMax(boolean positiveOnly)
Get the minimum and maximum xdata.
|
Range |
getYDataMinMax()
Get the minimum and maximum ydata.
|
Range |
getYDataMinMax(boolean positiveOnly)
Get the minimum and maximum ydata.
|
boolean |
isChronological() |
boolean |
removeDataProviderListener(IDataProviderListener listener)
Remove listener
|
void |
setChronological(boolean chronological) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasErrorsprotected boolean chronological
protected java.util.List<IDataProviderListener> listeners
protected Range xDataMinMax
protected Range yDataMinMax
public AbstractDataProvider(boolean chronological)
trace - the trace which the data provider will provide data to.chronological - true if the data is sorted chronologically on xAxis, which
means the data is sorted on X Axis.public abstract int getSize()
IDataProvidergetSize in interface IDataProviderIDataProvider.getSample(int)public abstract ISample getSample(int index)
IDataProvider
Synchronization: Since the data might change dynamically,
synchronize on the IDataProvider around calls
to getSize() and getSample().
getSample in interface IDataProviderindex - public Range getXDataMinMax()
IDataProvidergetXDataMinMax in interface IDataProviderpublic Range getYDataMinMax()
IDataProvidergetYDataMinMax in interface IDataProviderpublic Range getXDataMinMax(boolean positiveOnly)
IDataProvidergetXDataMinMax in interface IDataProviderpositiveOnly - if true, return values greater than zeropublic Range getYDataMinMax(boolean positiveOnly)
IDataProvidergetYDataMinMax in interface IDataProviderpositiveOnly - if true, return values greater than zeropublic Range getDataRange(boolean positiveOnly, boolean isAxis)
positiveOnly - if data is positive only (for log scale mode)isXAxis - isXAxis - if true, then this will return the updated range for the
XAxis, YAxis otherwisepublic Range getDataRange(boolean positiveOnly, boolean isXAxis, int lowerBound)
positiveOnly - if data is positive only (for log scale mode)isXAxis - if true, then this will return the updated range for the
XAxis, YAxis otherwiselowerBound - by default it should be 0public void setChronological(boolean chronological)
chronological - the chronological to setpublic boolean isChronological()
isChronological in interface IDataProviderpublic void addDataProviderListener(IDataProviderListener listener)
addDataProviderListener in interface IDataProviderlistener - public boolean removeDataProviderListener(IDataProviderListener listener)
removeDataProviderListener in interface IDataProviderlistener - protected void fireDataChange()