Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.DoubleData


                    val = 1.0;
                else if (reverse)
                    val = 2.0 / (1.0 + (val / targetVal));
                else
                    val = val / targetVal;
                data.setData(1, n, new DoubleData(val));
            }
        }
    }
View Full Code Here


            SimpleData result = (SimpleData) NUMBER_MAP.get(value);
            if (result == null) {
                try {
                    Number d = NUMBER_FORMAT.parse(value);
                    if (d != null)
                        result = new DoubleData(d.doubleValue(), false);
                } catch (ParseException e) {
                    throw new MalformedValueException();
                }
            }
            return result;
View Full Code Here

    protected double getValueAt(DataContext data, PropertyKey node) {
        String fullDataName = getDataName(node);
        SimpleData sd = data.getSimpleValue(fullDataName);
        if (sd instanceof DoubleData) {
            DoubleData dd = (DoubleData) sd;
            return dd.getDouble();
        }
        return 0;
    }
View Full Code Here

  }

  public void setString(String s) throws MalformedValueException {
    try {
      Number n = FMT.parse(s);
      value = new DoubleData(n.doubleValue());
    } catch (Exception pe) {
      throw new MalformedValueException();
    }
  }
View Full Code Here

  }

 
  public void setString(String s) throws MalformedValueException {
    try {
      value = new DoubleData(FormatUtil.parsePercent(s.trim()), true);
    } catch (Exception e) {
      throw new MalformedValueException();
    }
  }
View Full Code Here

     * numRows() or numCols(), respectively. */
    public SimpleData getData(int row, int col) {
        if (row == 0 || col == 0) throw new ArrayIndexOutOfBoundsException();
        Object o = data[row][col];
        if (o instanceof NumberData && ((NumberData)o).isDefined())
            return new DoubleData
                (((NumberData) o).getDouble() *
                 multiplier[useRowFormats ? row : col], false);
        else
            return (o instanceof SimpleData) ? (SimpleData) o : null;
    }
View Full Code Here

        // Save the LPI and UPI
        if (range instanceof DoubleData) {
            double est   = ((DoubleData) estimate).getDouble();
            double rng = ((DoubleData) range).getDouble();
            upi = new DoubleData(est + rng);
            lpi = new DoubleData(Math.max(0, est - rng));
        } else
            upi = lpi = N_A;
        putValue(getDataName("LPI"), lpi);
        putValue(getDataName("UPI"), upi);
View Full Code Here

        String inputFieldValue = (String) params.get(inputFieldName);
        SimpleData result = N_A;
        try {
            double value = Double.parseDouble(inputFieldValue);
            if (!Double.isInfinite(value) && !Double.isNaN(value))
              result = new DoubleData(value * mult);
        } catch (NumberFormatException nfe) { }
        return result;
    }
View Full Code Here

            switch (value.charAt(0)) {
            case '0': case '1': case '2': case '3': case '4':
            case '5': case '6': case '7': case '8': case '9':
            case '-': case '+': case '.': case ',':
                try {
                    result = new DoubleData(value);
                    result.setEditable(false);
                    return result;
                } catch (MalformedValueException mfe) {
                }
            }
View Full Code Here

    private void validateAndStoreData(SizeMetricApiRequestData request,
            String dataPrefix) {
        // parse and validate the supplied parameter values
        StringData description = getDescription(request);
        StringData sizeUnits = getSizeUnits(request);
        DoubleData actSize = getActualSize(request);

        // store them into the data repository
        putData(request, dataPrefix + "/" + DESCRIPTION_ELEM, description);
        putData(request, dataPrefix + "/" + UNITS_ELEM, sizeUnits);
        putData(request, dataPrefix + "/" + ACT_SIZE_ELEM, actSize);
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.