view gwt-client/src/main/java/org/dive4elements/river/client/client/event/RangeFilterEvent.java @ 5886:6a63456b99d9

Schema change, importer, i18n: additional field for federal state stations
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 30 Apr 2013 19:27:15 +0200
parents 172338b1407f
children ea9eef426962
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU AGPL (>=v3) 
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details. 
 */

package org.dive4elements.river.client.client.event;

import com.google.gwt.i18n.client.NumberFormat;

/**
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class RangeFilterEvent {

    protected Float from;
    protected Float to;


    public RangeFilterEvent(String from, String to) {
        NumberFormat nf = NumberFormat.getDecimalFormat();
        double d;

        try {
            d = nf.parse(from);
            this.from = Float.valueOf(String.valueOf(d));
        }
        catch(NumberFormatException nfe) {
            this.from = Float.NaN;
        }
        try {
            d = nf.parse(to);
            this.to = Float.valueOf(String.valueOf(d));
        }
        catch(NumberFormatException nfe) {
            this.to = Float.NaN;
        }
    }


    public Float getFrom() {
        return this.from;
    }


    public Float getTo() {
        return this.to;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org