/*
(non-Javadoc)

@see mtas.codec.util.DataCollector.MtasDataCollector#add(double[], int)
554667
@Override
  public MtasDataCollector<?, ?> add(double[] values, int number)
      throws IOException {
    MtasDataCollector<?, ?> dataCollector = add(false);
    setValue(newCurrentPosition, ArrayUtils.toObject(values), number,
        newCurrentExisting);
    return dataCollector;
  }
735752
public void addSeries( String seriesName, double[] x, double[] y ) {
        XYSeries series = new XYSeries(seriesName);
        for( int i = 0; i < x.length; i++ ) {
            series.add(x[i], y[i]);
        }
        dataset.addSeries(series);
    }
538728
void add(final double m, final Object pt) {
		if (count == 0) {
			set(m, pt);
		} else {
			count += 1;
			
			if (m != 0.0) {
				m0 += m;
				clusters.space.addScaled(m1, m, pt);
				clusters.space.addScaledSqr(m2, m, pt);
				update();
			}
		}
	}
1126383
@Override
  public void add(Object data, Class<?>... typeSpecs) {
    //    if (data == null) return;
    //
    //    typeSpecs = determineTypeSpecs(data, typeSpecs);
    //    if (this.getDefaultDataType() == null) this.setDefaultDataType(typeSpecs);
    //
    //    mReps.put(this.getSpecsAsString(typeSpecs), data);
    Representation representation = new Representation(data, typeSpecs);
    mReps.put(representation.getTypeSpecsString(), representation);
  }
287535
@SuppressWarnings({"unchecked", "ManualArrayToCollectionCopy"})
    public static <E, T extends E> Collection<E> addAll(Collection<E> c, T... array){
        for(T obj: array)
            c.add(obj);
        return c;
    }
204589
public void put(double[] val) {
    assert (val.length == elements.length);
    wsum += 1.0;
    for(int i = 0; i < elements.length; i++) {
      final double delta = val[i] - elements[i];
      elements[i] += delta / wsum;
    }
  }
1241085
public static double[] asDoubleArray(Collection collection) {
        double[] result = new double[collection.size()];
        int i = 0;
        for (Object c : collection) {
            result[i++] = asDouble(c);
        }
        return result;
    }
462579
public void add(double x, double y) {
        if (x < minX) minX = x;
        if (y < minY) minY = y;
        if (x > maxX) maxX = x;
        if (y > maxY) maxY = y;
    }
135007
public void add(double[] x) {
        if (root == null) {
            root = new Node();
            root.add(new Leaf(x));
            root.update(x);
        } else {
            root.add(x);
        }
    }
826994
@SuppressWarnings("unchecked")
    public static <E> void mergeArrayIntoCollection(Object array, Collection<E> collection) {
        if (collection == null) {
            throw new IllegalArgumentException("Collection must not be null");
        }
        Object[] arr = ObjectUtils.toObjectArray(array);
        for (Object elem : arr) {
            collection.add((E)elem);
        }
    }
811356
public void addValue(double value)
    {
        if (dataSetSize == dataSet.length)
        {
            // Increase the capacity of the array.
            int newLength = (int) (GROWTH_RATE * dataSetSize);
            double[] newDataSet = new double[newLength];
            System.arraycopy(dataSet, 0, newDataSet, 0, dataSetSize);
            dataSet = newDataSet;
        }
        dataSet[dataSetSize] = value;
        updateStatsWithNewValue(value);
        ++dataSetSize;
    }
992173
protected final void addDataCollector(final Class collectorName) {
		if (!DataCollector.class.isAssignableFrom(collectorName)) {
			throw new RuntimeException("Class must be subclass of DataCollector!");
		}
		collectors.add(collectorName);
	}
419692
public void addDatapoints(Map<Long, Double> datapoints) {
		if (datapoints != null) {
			_datapoints.putAll(datapoints);
		}
	}
559336
public static void add(@javax.annotation.Nonnull final DoubleSupplier f, @javax.annotation.Nonnull final double[] data) {
    for (int i = 0; i < data.length; i++) {
      data[i] += f.getAsDouble();
    }
  }
695901
final void addData(final AbstractMeter meter, final double data) {
        checkIfMeterExists(meter);
        meterResults.get(meter).add(data);
    }
368082
@Override
  public boolean addAll(int index, Collection<? extends Float> c) {
    if (index < 0 || index > size) {
      throw new IndexOutOfBoundsException();
    }
    ensureCapacity(size + c.size());
    size += c.size();
    for (int i = size + c.size() - 1, j = size - 1; j >= index; i--, j--) {
      elements[i] = elements[j];
    }
    for (float e : c) {
      elements[index++] = e;
    }
    return c.size() > 0;
  }
790957
public void add(Counter<? extends T> counter) {
        for (Map.Entry<? extends T,Integer> e : counter) {
            T t = e.getKey();
            Integer cur = counts.get(t);
            counts.put(t, (cur == null) ? e.getValue() : cur + e.getValue());
        }
    }