Package eu.planets_project.pp.plato.model.scales

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


            if ("FREE TEXT".equals(TEXT.toUpperCase())) {
                return new FreeStringScale();
            }

            if (TEXT.indexOf(Scale.SEPARATOR) != -1 ) {
                RestrictedScale v = null;
//              try {
//              v = new IntRangeScale();
//              v.setRestriction(TEXT);
//              } catch (IllegalArgumentException e) {
//              // do nothing, that's ok, thrown by IntRange -
//              // it means we don't have numbers, but an ordinary scale.
//              // proceed:
//              v = new OrdinalScale();
//              v.setRestriction(TEXT);
//              }
                v = new IntRangeScale();
                if (! ((IntRangeScale)v).validateAndSetRestriction(TEXT)) {
                    v= new OrdinalScale();
                    v.setRestriction(TEXT);
                }
                return v;
            }
        } catch (Exception e) {
            PlatoLogger.getLogger(this.getClass()).warn("invalid scale format, ignoring: "+TEXT,e);
        }
        //default behaviour: float scale and the TEXT as unit
        PositiveFloatScale v = new PositiveFloatScale();
        v.setUnit(TEXT);
        return v;
    }
View Full Code Here


            if ("?".equals(getTEXT())) {
                return null;
            }

            if (getTEXT().indexOf(Scale.SEPARATOR) != -1 ) {
                RestrictedScale v = null;
                v = new IntRangeScale();
                if (! ((IntRangeScale)v).validateAndSetRestriction(getTEXT())) {
                    v= new OrdinalScale();
                    v.setRestriction(getTEXT());
                }
                return v;
            }
        } catch (Exception e) {
            PlatoLogger.getLogger(this.getClass()).warn("invalid scale format, ignoring: "+getTEXT(),e);
        }

        //default behaviour: float scale and the TEXT as unit
        PositiveFloatScale v = new PositiveFloatScale();
        v.setUnit(getTEXT());
        return v;
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.scales.RestrictedScale

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.