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.shared.model; ingo@2962: ingo@2962: import java.io.Serializable; ingo@2962: felix@4309: /** Probably something like *Access, but from client side. */ gernotbelger@9099: public class FixFilter implements Serializable { ingo@2962: ingo@2962: protected String river; ingo@2962: protected double fromKm; ingo@2962: protected double toKm; ingo@2962: protected double currentKm; ingo@2962: protected int fromClass; ingo@2962: protected int toClass; ingo@2962: protected long fromDate; ingo@2962: protected long toDate; ingo@2962: protected boolean hasDate; ingo@2962: protected int[] events; ingo@2962: ingo@2962: public FixFilter() { ingo@2962: this.river = ""; ingo@2962: this.fromKm = -Double.MAX_VALUE; ingo@2962: this.toKm = -1; ingo@2962: this.currentKm = -1; ingo@2962: this.fromClass = -1; ingo@2962: this.toClass = -1; rrenkert@8400: this.fromDate = Long.MIN_VALUE; rrenkert@8400: this.toDate = Long.MIN_VALUE; ingo@2962: this.hasDate = false; ingo@2962: this.events = new int[0]; ingo@2962: } ingo@2962: gernotbelger@9099: public void setRiver(final String river) { ingo@2962: this.river = river; ingo@2962: } ingo@2962: gernotbelger@9099: public void setFromKm(final double from) { ingo@2962: this.fromKm = from; ingo@2962: } ingo@2962: gernotbelger@9099: public void setToKm(final double to) { ingo@2962: this.toKm = to; ingo@2962: } ingo@2962: gernotbelger@9099: public void setCurrentKm(final double km) { ingo@2962: this.currentKm = km; ingo@2962: } ingo@2962: gernotbelger@9099: public void setFromClass(final int from) { ingo@2962: this.fromClass = from; ingo@2962: } ingo@2962: gernotbelger@9099: public void setToClass(final int to) { ingo@2962: this.toClass = to; ingo@2962: } ingo@2962: gernotbelger@9099: public void setFromDate(final long from) { ingo@2962: this.hasDate = true; ingo@2962: this.fromDate = from; ingo@2962: } ingo@2962: gernotbelger@9099: public void setToDate(final long to) { ingo@2962: this.hasDate = true; ingo@2962: this.toDate = to; ingo@2962: } ingo@2962: gernotbelger@9099: public void setEvents(final int[] ev) { ingo@2962: this.events = ev; ingo@2962: } ingo@2962: ingo@2962: public String getRiver() { ingo@2962: return this.river; ingo@2962: } ingo@2962: gernotbelger@9099: public double getLowerKm() { gernotbelger@9099: return Math.min(this.fromKm, this.toKm); ingo@2962: } ingo@2962: gernotbelger@9099: public double getUpperKm() { gernotbelger@9099: return Math.max(this.fromKm, this.toKm); ingo@2962: } ingo@2962: gernotbelger@9099: // public double getFromKm() { gernotbelger@9099: // return this.fromKm; gernotbelger@9099: // } gernotbelger@9099: // gernotbelger@9099: // public double getToKm() { gernotbelger@9099: // return this.toKm; gernotbelger@9099: // } gernotbelger@9099: ingo@2962: public double getCurrentKm() { ingo@2962: return this.currentKm; ingo@2962: } ingo@2962: ingo@2962: public int getFromClass() { ingo@2962: return this.fromClass; ingo@2962: } ingo@2962: ingo@2962: public int getToClass() { ingo@2962: return this.toClass; ingo@2962: } ingo@2962: ingo@2962: public long getFromDate() { ingo@2962: return this.fromDate; ingo@2962: } ingo@2962: ingo@2962: public long getToDate() { ingo@2962: return this.toDate; ingo@2962: } ingo@2962: ingo@2962: public int[] getEvents() { ingo@2962: return this.events; ingo@2962: } rrenkert@8400: rrenkert@8400: public boolean hasDate() { gernotbelger@9099: return this.fromDate != Long.MIN_VALUE && this.toDate != Long.MIN_VALUE; rrenkert@8400: } ingo@2962: } felix@4309: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :