teichmann@5861: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5861: * Software engineering by Intevation GmbH teichmann@5861: * teichmann@5861: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5861: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5861: * documentation coming with Dive4Elements River for details. teichmann@5861: */ teichmann@5861: teichmann@5835: package org.dive4elements.river.client.client.event; raimund@1534: raimund@1536: import com.google.gwt.i18n.client.NumberFormat; raimund@1536: raimund@1534: /** raimund@1534: * @author Raimund Renkert raimund@1534: */ raimund@1534: public class RangeFilterEvent { raimund@1534: raimund@1536: protected Float from; raimund@1536: protected Float to; raimund@1534: raimund@1534: raimund@1534: public RangeFilterEvent(String from, String to) { raimund@1536: NumberFormat nf = NumberFormat.getDecimalFormat(); raimund@1536: double d; raimund@1536: raimund@1536: try { raimund@1536: d = nf.parse(from); raimund@1536: this.from = Float.valueOf(String.valueOf(d)); raimund@1536: } raimund@1536: catch(NumberFormatException nfe) { raimund@1536: this.from = Float.NaN; raimund@1536: } raimund@1536: try { raimund@1536: d = nf.parse(to); raimund@1536: this.to = Float.valueOf(String.valueOf(d)); raimund@1536: } raimund@1536: catch(NumberFormatException nfe) { raimund@1536: this.to = Float.NaN; raimund@1536: } raimund@1534: } raimund@1534: raimund@1534: raimund@1536: public Float getFrom() { raimund@1536: return this.from; raimund@1534: } raimund@1534: raimund@1534: raimund@1536: public Float getTo() { raimund@1536: return this.to; raimund@1534: } raimund@1534: } raimund@1534: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :