public int add (DoubleArrayList data) {
XYSeries serie = new XYSeries(" ");
DoubleArrayList temp = data.copy(); // deep copy
XYSeriesCollection tempSeriesCollection = (XYSeriesCollection) seriesCollection;
temp.trimToSize(); // set capacity to the current size
temp.quickSortFromTo(0, temp.size()-1); // sort list in increasing order, simplify the next processings
double[] elements = temp.elements();
int count = 0;
int j = 0;