Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.DoubleData


            throw badRequest(MISSING_PARAM, "No value was provided for the ",
                "required parameter 'actSize'").putAttr("param", "actSize");

        try {
            double result = Double.parseDouble(paramVal.trim());
            return new DoubleData(result);
        } catch (NumberFormatException nfe) {
            throw badRequest(BAD_PARAM, "The 'actSize' parameter value '",
                paramVal, "' is not a valid number")
                    .putAttr("param", "actSize");
        }
View Full Code Here


        result.setColName(0, "");
        result.setColName(1, "Total # Items");

        for (int i = 0; i < len; i++) {
            result.setRowName(i + 1, SIZE_NAMES.get(i));
            result.setData(i + 1, 1, new DoubleData(histogram[i]));
        }
        this.data = result;
    }
View Full Code Here

        long pathTime = (pathValue)[0];
        if (currentVal instanceof NumberData
                && ((NumberData) currentVal).getDouble() == pathTime)
            return;

        data.putValue(dataName, new DoubleData(pathTime, false));
    }
View Full Code Here

  }
  private void modifyDataValue(String dataName, int increment,
          boolean ignoreExistingValue) {
    String prefix = dataPrefix + getDataNamespace();
    dataName = DataRepository.createDataName(prefix, dataName);
    DoubleData val;
    try {
      val = (DoubleData)data.getValue(dataName);
    } catch (ClassCastException cce) {
      return;          // Do nothing - don't overwrite values of other types
    }
    if (val instanceof NumberFunction) {
      return;          // Do nothing - don't overwrite old-style calculations
    } else if (ignoreExistingValue && increment == 0) {
      if (val != null && val.getDouble() != 0)
        data.restoreDefaultValue(dataName);
      return;
    } else if (val == null || ignoreExistingValue) {
      val = new DoubleData(increment);
    } else {
      val = new DoubleData(val.getInteger() + increment);
    }
    val.setEditable(false);
    data.putValue(dataName, val);
  }
View Full Code Here

        return StringData.create(s);
    }

    private DoubleData num(Object n, int fraction) {
        if (n instanceof Number) {
            return new DoubleData(((Number) n).doubleValue() / fraction);
        } else {
            return ImmutableDoubleData.READ_ONLY_ZERO;
        }
    }
View Full Code Here

    }

    private void setEstimate(String prefix, double value) {
        data.userPutValue(
            DataRepository.createDataName(prefix, ESTIMATED_TIME),
            new DoubleData(value, true));
    }
View Full Code Here

        String defectType;

        while (i.hasNext()) {
            defectType = (String) i.next();
            data.setRowName(numRows, defectType);
            data.setData(numRows, 1, new DoubleData(getRow(defectType)[0]));
            numRows--;
        }
        data.sortBy(1, true);
    }
View Full Code Here

     * @return a SimpleData value, or null if this object does not correspond to
     *         one of the supported types.
     */
    protected SimpleData toSimpleData(Object object) {
        if (object instanceof Number) {
            return new DoubleData(((Number) object).doubleValue());
        } else if (object instanceof String) {
            return StringData.create((String) object);
        } else if (object instanceof Date) {
            return new DateData((Date) object, false);
        } else {
View Full Code Here

     *
     * This method <b>must</b> be thread-safe.
     */
    public Object call(List arguments, ExpressionContext context)
    {
        return new DoubleData(collapseLists(arguments, 0).size());
    }
View Full Code Here

        int row = 0;
        for (Entry<String, DataPair> e : timeInPhase.entrySet()) {
            if (++row > numRows)
                break;
            plan.setRowName(row, e.getKey());
            plan.setData(row, 1, new DoubleData(e.getValue().plan));
            actual.setRowName(row, e.getKey());
            actual.setData(row, 1, new DoubleData(e.getValue().actual));
        }
        out.print("<p>\n");
        writeChart("Plan", "Estimated_Time", plan);
        out.print("&nbsp;");
        writeChart("Actual", "Time", actual);
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.data.DoubleData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.