Package eu.planets_project.pp.plato.model.transform

Examples of eu.planets_project.pp.plato.model.transform.OrdinalTransformer


                    }
                }
                nt.defaults(min,max);
                nt.setMode(TransformationMode.LINEAR);
            } else {
                OrdinalTransformer ot = (OrdinalTransformer) t;
                if  (leaf.getScale() instanceof BooleanScale) {
           
                    ot.getMapping().put("Yes", new TargetValueObject(5));
                    ot.getMapping().put("No", new TargetValueObject(1));
                } else {
                // total nonsense placeholder for setting something
                // until we have proper heuristics and property-specific
                // transformers in the knowledge base
                    for (String s: ot.getMapping().keySet()) {
                        ot.getMapping().put(s, new TargetValueObject(3.33));
                    }
                }
            }
        }
    }   
View Full Code Here


                    "Can't set DefaultTransformer, no scale set!");
            this.setTransformer(null);
            return;
        }
        if (ScaleType.ordinal.equals(scale.getType())) {
            OrdinalTransformer t = new OrdinalTransformer();
            this.setTransformer(t);
            if (!(scale instanceof FreeStringScale)) {
                Map<String, TargetValueObject> map = t.getMapping();
                OrdinalScale o = (OrdinalScale) scale;
                for (String s : o.getList()) {
                    map.put(s, new TargetValueObject());
                }
            }
View Full Code Here

    public void initTransformer(Double defaultTarget) {

        if (scale instanceof FreeStringScale) {
            FreeStringScale freeScale = (FreeStringScale) scale;
            // We collect all distinct actually EXISTING values
            OrdinalTransformer t = (OrdinalTransformer) transformer;
            Map<String, TargetValueObject> map = t.getMapping();

            HashSet<String> allValues = new HashSet<String>();
            for (Values values: valueMap.values()) {
                for (Value v : values.getList()) {
                    FreeStringValue text = (FreeStringValue) v;
View Full Code Here

            log.debug(l.getName()+": "+l.getScale().getDisplayName());
            for (String s: l.getValueMap().keySet()) {
                log.debug("   value entry for "+s);
            }
            if (l.getTransformer() instanceof OrdinalTransformer) {
                OrdinalTransformer t =(OrdinalTransformer) l.getTransformer();
                for (String s: t.getMapping().keySet()) {
                    log.debug("   transformer entry for "+s);
                }
            }

        }
View Full Code Here

        if (node.isLeaf()) {
            Leaf leaf = (Leaf) node;
            Transformer t = leaf.getTransformer();
            Hibernate.initialize(t);
            if (t instanceof OrdinalTransformer) {
                OrdinalTransformer nt = (OrdinalTransformer) t;
                Hibernate.initialize(nt.getMapping());
            }
            //log.debug("hibernate initialising Transformer: " + leaf.getTransformer());
            for (Values value : leaf.getValueMap().values()) {
                Hibernate.initialize(value);
            }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.transform.OrdinalTransformer

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.