Examples of FloatScale


Examples of eu.planets_project.pp.plato.model.scales.FloatScale

       
        Measurement measurement = new Measurement();
        MeasurableProperty property = new MeasurableProperty();
        String propertyName = m.getProperty().getName();
        property.setName(propertyName+":accumulated:average");
        FloatScale scale = new FloatScale();
        property.setScale(scale);
        measurement.setProperty(property);
       
        scale.setUnit(""+list.size());
   
        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

Examples of eu.scape_project.planning.model.scales.FloatScale

public class LeafPersistenceIT extends PersistenceTest{
   
    @Test
    public void testRemovingScale(){
        Leaf l = new Leaf();
        l.setScale(new FloatScale());
        l.setName("a float scale");

        em.getTransaction().begin();
        em.persist(l);
        em.getTransaction().commit();
View Full Code Here

Examples of eu.scape_project.planning.model.scales.FloatScale

        scales.add(new BooleanScale());
        scales.add(new YanScale());
        scales.add(new OrdinalScale());
        scales.add(new IntegerScale());
        scales.add(new IntRangeScale());
        scales.add(new FloatScale());
        scales.add(new FloatRangeScale());
        scales.add(new PositiveFloatScale());
        scales.add(new PositiveIntegerScale());
        scales.add(new FreeStringScale());
View Full Code Here

Examples of eu.scape_project.planning.model.scales.FloatScale

    }

    @Test
    public void testResetValues_Different_Scale_In_Alternatives() {
        Leaf l = new Leaf();
        l.setScale(new FloatScale());
        Alternative a = new Alternative("test", "test");
        List<Alternative> alternatives = new ArrayList<Alternative>();
        alternatives.add(a);

        Map<String, Values> map = new HashMap<String, Values>();
View Full Code Here

Examples of eu.scape_project.planning.model.scales.FloatScale

        Assert.assertTrue(ord.getMapping().containsKey("HORRIBLE"));
    }

    @Test
    public void testSetDefaultTransformer_Scale_Equals_NonOrdinal() {
        FloatScale o = new FloatScale();
        Leaf l = new Leaf();
        l.setScale(o);
        l.setDefaultTransformer();
        Assert.assertTrue(l.getTransformer() instanceof NumericTransformer);
    }
View Full Code Here

Examples of eu.scape_project.planning.model.scales.FloatScale

        if ("Boolean".equalsIgnoreCase(scaleName)) {
            return new BooleanScale();
        } else if ("FreeText".equalsIgnoreCase(scaleName)) {
            return new FreeStringScale();
        } else if ("Number".equalsIgnoreCase(scaleName)) {
            return new FloatScale();
        } else if ("PositiveNumber".equalsIgnoreCase(scaleName)) {
            return new PositiveFloatScale();
        } else if ("PositiveInteger".equalsIgnoreCase(scaleName)) {
            return new PositiveIntegerScale();
        } else if ("Ordinal".equalsIgnoreCase(scaleName)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.