Exemplo n.º 1
0
  /**
   * Equivalent to <code>{@link #incrementCount}({o}, count)</code>; only works for a depth 1
   * GeneralizedCounter.
   */
  public void incrementCount1D(K o, double count) {
    if (depth > 1) {
      wrongDepth();
    }

    addToTotal(count);

    if (tempMDouble == null) {
      tempMDouble = new MutableDouble();
    }
    tempMDouble.set(count);
    MutableDouble oldMDouble = (MutableDouble) map.put(o, tempMDouble);

    if (oldMDouble != null) {
      tempMDouble.set(count + oldMDouble.doubleValue());
    }

    tempMDouble = oldMDouble;
  }