code: public DataPoint add(long value) {
          switch (type) {
          case MINIMUM:
              this.value = Math.min(this.value, value);
              break;
          case MAXIMUM:
              this.value = Math.max(this.value, value);
              break;
          case AVERAGE:
          case SUM:
              this.value += value;
              this.numPoints++;
              break;
          default:
              throw new IllegalStateException("Unknown type [" + type + "]!");
          }
          return this;
      }
docs: Adds a value to the data point.
  
  <p>
  How the value is actually added depends on type of the data point. See
  {@link Type}.
  </p>
  
  @param value
  @return