Example usage for java.lang Double toString

List of usage examples for java.lang Double toString

Introduction

In this page you can find the example usage for java.lang Double toString.

Prototype

public static String toString(double d) 

Source Link

Document

Returns a string representation of the double argument.

Usage

From source file:com.wormsim.tracking.TrackedDouble.java

@Override
public String toRecentEffectiveDataCountString() {
    return Double.toString(this.getRecentEffectiveDataCount());
}

From source file:byps.BBufferJson.java

public void putDouble(String name, double v) {
    putJsonValueAscii(name, Double.toString(v), STRING_WITHOUT_QUOTE);
}

From source file:ml.shifu.shifu.core.binning.EqualIntervalBinning.java

public String objToString() {
    return super.objToString() + Character.toString(FIELD_SEPARATOR) + Double.toString(maxVal)
            + Character.toString(FIELD_SEPARATOR) + Double.toString(minVal);
}

From source file:com.epam.ta.reportportal.ws.converter.builders.Utils.java

public static Log getRandomLog() {
    Log log = Utils.getTestLog();/*from   ww  w  . j  a v a2 s.co  m*/
    log.setId(null);
    log.setTestItemRef("");
    log.setLogMsg(log.getLogMsg() + Double.toString(Math.random()));
    return log;
}

From source file:dhbw.ka.mwi.businesshorizon2.ui.process.scenario.ScenarioPresenter.java

/**
 * Diese Methode fuegt dem Projekt ein neues Szenario hinzu und zeigt die
 * dazugehoerigen Eingabefelder auf dem Screen an.
 * /*from   ww w .ja  v a2s.  c  om*/
 * @author Julius Hacker
 */
public void addScenario() {
    Szenario scenario = new Szenario(0.0, 0.0, 0.0, 0.0, true);
    this.projectProxy.getSelectedProject().addScenario(scenario);
    getView().addScenario(Double.toString(scenario.getRateReturnEquity()),
            Double.toString(scenario.getRateReturnCapitalStock()),
            Double.toString(scenario.getCorporateAndSolitaryTax()), Double.toString(scenario.getBusinessTax()),
            scenario.isIncludeInCalculation(), this.projectProxy.getSelectedProject().getScenarios().size());
    //Szenarioseite aktualisieren
    eventBus.fireEvent(new ShowScenarioViewEvent());

}

From source file:eu.optimis.ecoefficiencytool.core.EcoEffForecasterIP.java

public synchronized String forecastVMEcoEfficiency(String vmId, String type, Long timeSpan) {
    double[] ecoefficiencyForecast = forecastVMEcoEfficiency(vmId, timeSpan);
    //Return desired ecoefficiency forecast type.
    if (type.equalsIgnoreCase("energy")) {
        return Double.toString(ecoefficiencyForecast[0]);
    } else {/*from   www . j av  a  2  s .  c o m*/
        return Double.toString(ecoefficiencyForecast[1]);
    }
}

From source file:com.jaredrummler.android.devices.Main.java

private static String getStringCellValue(Cell cell) {
    switch (cell.getCellType()) {
    case Cell.CELL_TYPE_BOOLEAN:
        return cell.getBooleanCellValue() ? "true" : "false";
    case Cell.CELL_TYPE_NUMERIC:
        return Double.toString(cell.getNumericCellValue());
    case Cell.CELL_TYPE_STRING:
    default:// w ww  .j a  v  a2s . co m
        return cell.getStringCellValue();
    }
}

From source file:eu.planets_project.pp.plato.evaluation.evaluators.ImageComparisonEvaluator.java

public HashMap<MeasurementInfoUri, Value> evaluate(Alternative alternative, SampleObject sample,
        DigitalObject result, List<MeasurementInfoUri> measurementInfoUris, IStatusListener listener)
        throws EvaluatorException {

    //listener.updateStatus(NAME + ": Start evaluation"); //" for alternative: %s, sample: %s", NAME, alternative.getName(), sample.getFullname()));
    setUp();/*from www.  j ava2 s  .c  o m*/
    try {
        HashMap<MeasurementInfoUri, Value> results = new HashMap<MeasurementInfoUri, Value>();

        saveTempFile(sample);
        saveTempFile(result);

        // NOTE: imageEvaluator is still called once per leaf !
        // -> could be optimized, but the used minimee evaluator will do separate calls anyway 
        ImageCompareEvaluator imageEvaluator = new ImageCompareEvaluator();

        for (MeasurementInfoUri measurementInfoUri : measurementInfoUris) {
            String propertyURI = measurementInfoUri.getAsURI();
            String fragment = measurementInfoUri.getFragment();
            Scale scale = descriptor.getMeasurementScale(measurementInfoUri);
            if (scale == null) {
                // This means that I am not entitled to evaluate this measurementInfo and therefore supposed to skip it:
                continue;
            }
            if ((propertyURI != null) && propertyURI.startsWith(OBJECT_IMAGE_SIMILARITY + "#")) {
                Value v = null;
                if (fragment.equals("equal")) {
                    Double d = imageEvaluator.evaluate(tempDir.getAbsolutePath(), tempFiles.get(sample),
                            tempFiles.get(result), "AE");

                    if (d.compareTo(Scale.MAX_VALUE) == 0) {
                        // No: only evaluation results are returned, no error messages
                        // v.setComment("ImageMagick compare failed or could not be called");
                    } else {
                        v = scale.createValue();
                        ((BooleanValue) v).bool(d.compareTo(0.0) == 0);
                        v.setComment(
                                "ImageMagick compare returned " + Double.toString(d) + " different pixels");
                    }
                    //                log.debug("difference" + Double.toString(Scale.MAX_VALUE-d));
                } else {
                    Double d = imageEvaluator.evaluate(tempDir.getAbsolutePath(), tempFiles.get(sample),
                            tempFiles.get(result), fragment);
                    if (d == null) {
                        // No: only evaluation results are returned, no error messages
                        // v = leaf.getScale().createValue();
                        // v.setComment("ImageMagick comparison failed");
                    } else {
                        v = scale.createValue();
                        if (v instanceof FloatValue) {
                            ((FloatValue) v).setValue(d);
                            v.setComment("computed by ImageMagick compare");
                        } else if (v instanceof PositiveFloatValue) {
                            ((PositiveFloatValue) v).setValue(d);
                            v.setComment("computed by ImageMagick compare");
                        } else {
                            v.setComment("ImageMagick comparison failed - wrong Scale defined.");
                        }
                    }
                }
                if (v != null) {
                    // add the value to the result set
                    results.put(measurementInfoUri, v);
                }
            }
        }
        return results;
    } finally {
        tearDown();
    }
}