public interface IlvDataSet
IlvDataSet
interface also enables data queries based on
data interval (getDataInside(ilog.views.chart.IlvDataWindow, int, boolean)
method).
Notes about the indices:
getDataCount()
will then return n.isXValuesSorted()
method should be
implemented to return true; this will allow some charts operations to
run more efficiently.getDataCount()
.getDataCount()
-1. An arbitrary sub-interval of this
interval is also OK. For example, the IlvCyclicDataSet
in
LINEAR_MODE
uses a set of indices that is only a
sub-interval of [0,getDataCount()-1]
.Double.NaN
or equal to
getUndefValue().doubleValue()
is an "undefined point".
The polyline renderer represents it through a hole.Modifier and Type | Method and Description |
---|---|
void |
addData(double x,
double y)
Adds a data point at the end of this data set.
|
void |
addDataSetListener(DataSetListener listener)
Adds the specified listener to receive events concerning changes
on this data set.
|
IlvDataPoints |
getData()
Returns all the data points held by this data set.
|
IlvDataPoints |
getDataBetween(int iMin,
int iMax)
Returns the data points between the two specified indices.
|
int |
getDataCount()
Returns the number of data points held by this data set.
|
IlvDataPoints |
getDataInside(IlvDataWindow window,
int adjCount,
boolean continuous)
Returns the data points inside the specified data window.
|
String |
getDataLabel(int idx)
Returns the label associated with the data point at the specified index.
|
String |
getName()
Returns the name of this data set.
|
Object |
getProperty(Object key)
Returns the value of the property associated with the specified key.
|
Double |
getUndefValue()
Returns a value that is used to mark a data point as undefined.
|
double |
getXData(int idx)
Returns the x-value of the data point at the specified index.
|
IlvDataInterval |
getXRange(IlvDataInterval range)
Returns the limits of the x-values handled by this data set.
|
double |
getYData(int idx)
Returns the y-value of the data point at the specified index.
|
IlvDataInterval |
getYRange(IlvDataInterval range)
Returns the limits of the y-values handled by this data set.
|
boolean |
isEditable()
Indicates whether the data set is editable.
|
boolean |
isXValuesSorted()
Indicates whether the X values of the data points managed by
this data set are sorted into ascending order.
|
void |
putProperty(Object key,
Object value,
boolean notify)
Adds a property to this data set.
|
void |
removeDataSetListener(DataSetListener listener)
Removes the specified listener from this data set.
|
void |
setData(int idx,
double x,
double y)
Modifies the data point at the specified index.
|
String getName()
int getDataCount()
double getXData(int idx)
idx
- a data point index, >= 0, < getDataCount()
double getYData(int idx)
idx
- a data point index, >= 0, < getDataCount()
void setData(int idx, double x, double y)
idx
- a data point index, >= 0, < getDataCount()
x
- the new x coordinate of the point (if this data set supports
setting arbitrary x values)y
- the new y coordinate of the pointvoid addData(double x, double y)
x
- the x coordinate of the new pointy
- the y coordinate of the new pointString getDataLabel(int idx)
These labels are used in the following situations:
IlvChartRenderer.DATA_LABEL
,point
, as value of the
label
property.idx
- a data point index, >= 0, < getDataCount()
boolean isEditable()
If this method returns true
, the methods
addData(double, double)
and setData(int, double, double)
can be called to
modify the data set contents. Otherwise, these editing methods
may have empty implementations.
Double getUndefValue()
null
, in which case it is assumed
that all undefined data in the data set is represented by NaN values.IlvDataInterval getXRange(IlvDataInterval range)
null
, a new
IlvDataInterval
is allocated.IlvDataInterval getYRange(IlvDataInterval range)
null
, a new
IlvDataInterval
is allocated.boolean isXValuesSorted()
isXValuesSorted()
is true
, the
particular IlvDataSet
implementation class guarantees
that for any two indices i and j such that
i < j,
getXData(i) <= getXData(j)
.IlvDataPoints getData()
Note: The returned array of data points may have less than
getDataCount()
points; this is the case, for example, for
an IlvCyclicDataSet
in LINEAR_MODE
or for an
IlvLODDataSet
.
For optimal performance, you should dispose()
the resulting
object when done with it.
IlvDataPoints
representing all points.
May return null
if there are no such points.IlvDataPoints getDataBetween(int iMin, int iMax)
For optimal performance, you should dispose()
the resulting
object when done with it.
iMin
- a data point index, >= 0, < getDataCount()
iMax
- a data point index, >= iMin, < getDataCount()
IlvDataPoints
representing the requested points.
May return null
if there are no such points.
Returns null
if iMin > iMax.IlvDataPoints getDataInside(IlvDataWindow window, int adjCount, boolean continuous)
For optimal performance, you should dispose()
the resulting
object when done with it.
window
- The considered data window.adjCount
- The number of data points immediately outside the
data window that must be returned by the request. If this parameter
is equal to 0
, only the points within the data window are
returned. A value that is not equal to 0
is only relevant
when requesting a continuous set of points (see the meaning of the
continuous
parameter).continuous
- Indicates whether the indices of the returned point
set may have holes or not. If false
, only data points
inside the given data window are returned, and possibly
adjCount data points on each side, even if the resulting
set of indices has holes, like for example
[1 2 4 7]
. If true
, a set of data points
with continuous indices is returned, even if some of them lie outside
the given data window, for example [1 2 3 4 5 6 7]
.IlvDataPoints
representing the requested points.
May return null
if there are no such points.Object getProperty(Object key)
key
- The key of the property to retrieve.putProperty(java.lang.Object, java.lang.Object, boolean)
,
IlvDataSetProperty
void putProperty(Object key, Object value, boolean notify)
key
- The key of this property. A key cannot be null
,
and must be designed to be used as a key of an associative map.value
- The value of this property. A null
value means
that the property corresponding to the specified key must be removed.notify
- If true
, changes to properties are reported
with DataSetPropertyEvent
events.
In that case, the name of the property in the event is key.toString().getProperty(java.lang.Object)
,
IlvDataSetProperty
void addDataSetListener(DataSetListener listener)
void removeDataSetListener(DataSetListener listener)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.