|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.internal.CSVDataProvider
com.xj.anylogic.engine.analysis.ChartItem
com.xj.anylogic.engine.analysis.DataSet
public class DataSet
A data set capable of storing 2D (X,Y) data of type double and maintaining the
up-to-date minimum and maximum of the stored data for each dimension. The data
set keeps a given limited number of the latest data items.
Please note that adding a new item when the dataset is full will cause loss of
the oldest sample and, if the lost item contained minimum or maximum, will
initiate a new search for min/max, which may be quite time consuming for large
datasets. Therefore for large datasets it is recommended to have the size not
less than the number of items yoiu plan to add.
| Constructor Summary | |
|---|---|
DataSet(int capacity)
Constructs a 2D data set with data of type double with a given capacity. |
|
DataSet(int capacity,
DataUpdater updater)
Constructs a 2D data set with data of type double with a given capacity. |
|
| Method Summary | |
|---|---|
void |
add(double y)
Adds a new data item to the data set. |
void |
add(double x,
double y)
Adds a new data item to the data set. |
void |
allowDuplicateX(boolean yes)
Sets the way of handling two subsequent calls of add() with identical X values. |
void |
allowDuplicateY(boolean yes)
Sets the way of handling two subsequent calls of add() with identical Y values. |
void |
destroyUpdater()
This method is used to 'disconnect' this data class from the active object/experiment this object was defined in. |
boolean |
duplicateXAllowed()
Tests if subsequent data items with same X values are allowed in this dataset. |
boolean |
duplicateYAllowed()
Tests if subsequent data items with same Y values are allowed in this dataset. |
void |
fillFrom(DataSet ds)
Makes this dataset an exact copy of the given original dataset. |
void |
fillFrom(TableFunction tf)
Discards all existing data, sets the capacity to equal to the number of entries in the given table function and fills the dataset from the given table function. |
int |
getCapacity()
Returns the capacity of the data set. |
double |
getX(int i)
Returns the x of the data items with a given index (which must be in the range 0..size()-1). |
double |
getXMax()
Returns the maximum of all x values of all stored items, or Double.NEGATIVE_INFINITY in case there are no items. |
double |
getXMin()
Returns the minimum of all x values of all stored data items, or Double.POSITIVE_INFINITY in case there are no items. |
double |
getY(int i)
Returns the y of the data items with a given index (which must be in the range 0..size()-1). |
double |
getYMax()
Returns the maximum of all y values of all stored items, or Double.NEGATIVE_INFINITY in case there are no items. |
double |
getYMin()
Returns the minimum of all y values of all stored items, or Double.POSITIVE_INFINITY in case there are no items. |
void |
reset()
Discards all stored data and their minimum/maximum. |
void |
setCapacity(int newcapacity)
Resizes the data set according to the new capacity. |
int |
size()
Returns the number of items stored in the data set. |
java.lang.String |
toString()
Returns a tab-separated multi-line textual representation of the data set containing not more than 1000 data items. |
void |
update()
Should be overridden and call add( x, y ) if the user has specified the values for horizontal and/or vertical axes. |
| Methods inherited from class com.xj.anylogic.engine.analysis.ChartItem |
|---|
getVersion |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataSet(int capacity)
capacity - the maximum number of (x,y) items the data set can store
public DataSet(int capacity,
DataUpdater updater)
capacity - the maximum number of (x,y) items the data set can storeupdater - updater which may be used instead of overriding
update() method| Method Detail |
|---|
public void destroyUpdater()
public void reset()
public void setCapacity(int newcapacity)
newcapacity - the new size of the data setpublic int getCapacity()
public void allowDuplicateY(boolean yes)
yes - if true, two entries in the dataset will be created, otherwise second item will override the last one.public boolean duplicateYAllowed()
public void allowDuplicateX(boolean yes)
yes - if true, two entries in the dataset will be created, otherwise second item will override the last one.public boolean duplicateXAllowed()
public void add(double x,
double y)
x - the x value of the data itemy - the y value of the data itempublic void add(double y)
y - the y value of the data itempublic void fillFrom(DataSet ds)
ds - the original datasetpublic void fillFrom(TableFunction tf)
tf - the table function to copy data frompublic void update()
update in class ChartItempublic double getXMin()
public double getXMax()
public double getYMin()
public double getYMax()
public int size()
public double getX(int i)
i - the index of the data items
public double getY(int i)
i - the index of the data items
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||