teichmann@5861: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5861: * Software engineering by Intevation GmbH teichmann@5861: * teichmann@5993: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5861: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5993: * 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: teichmann@7731: private static Float asFloat(NumberFormat nf, String x) { teichmann@7731: try { teichmann@7731: return Float.valueOf((float)nf.parse(x)); teichmann@7731: } teichmann@7731: catch (NumberFormatException nfe) { teichmann@7731: return Float.NaN; teichmann@7731: } teichmann@7731: } teichmann@7731: raimund@1534: raimund@1534: public RangeFilterEvent(String from, String to) { raimund@1536: NumberFormat nf = NumberFormat.getDecimalFormat(); raimund@1536: teichmann@7731: this.from = asFloat(nf, from); teichmann@7731: this.to = asFloat(nf, to); 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 :