Package eu.planets_project.pp.plato.model.values

Examples of eu.planets_project.pp.plato.model.values.FloatValue


        Double d = 0.0;
        for (Measurement entry : list) {
            INumericValue value = (INumericValue) entry.getValue();
            d+= value.value();
        }
        FloatValue average = (FloatValue) new FloatScale().createValue();
        average.setValue(d/list.size());
        measurement.setValue(average);
        return measurement;
    }
View Full Code Here


    /**
     * @see eu.planets_project.pp.plato.model.scales.Scale#createValue()
     */
    @Override
    public Value createValue() {
        Value v = new FloatValue();
        v.setScale(this);
        return v;
    }
View Full Code Here

     */
    @Override
    public boolean isEvaluated(Value value) {
        boolean evaluated = false;
        if ((value != null) && (value instanceof FloatValue)) {
            FloatValue v = (FloatValue)value;

            evaluated = v.isChanged();
        }
        return evaluated;
    }
View Full Code Here

public class FloatValueTest {
   
    @Test
    public void testFormattedValue() {
        FloatValue fv = new FloatValue();
       
        double d = 1.234567890123450;
        double d2 = d;
       
        for (int i = 1; i < 30; i++) {
            fv.setValue(d);
            System.out.println(fv.getFormattedValue());
            fv.setValue(-d);
            System.out.println(fv.getFormattedValue());
            fv.setValue(d2);
            System.out.println(fv.getFormattedValue());
            fv.setValue(-d2);
            System.out.println(fv.getFormattedValue());
            d = d * 10;
            d2 = d2 / 10.;
        }
       
       
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.values.FloatValue

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.