Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FixFilter.java @ 9099:850ce16034e9
2.3.4.1.10 Berechnung mit Start-km > End-km
author | gernotbelger |
---|---|
date | Mon, 28 May 2018 13:22:45 +0200 |
parents | 319aa972a1a3 |
children |
comparison
equal
deleted
inserted
replaced
9098:32dd7e761e4e | 9099:850ce16034e9 |
---|---|
9 package org.dive4elements.river.client.shared.model; | 9 package org.dive4elements.river.client.shared.model; |
10 | 10 |
11 import java.io.Serializable; | 11 import java.io.Serializable; |
12 | 12 |
13 /** Probably something like *Access, but from client side. */ | 13 /** Probably something like *Access, but from client side. */ |
14 public class FixFilter implements Serializable{ | 14 public class FixFilter implements Serializable { |
15 | 15 |
16 protected String river; | 16 protected String river; |
17 protected double fromKm; | 17 protected double fromKm; |
18 protected double toKm; | 18 protected double toKm; |
19 protected double currentKm; | 19 protected double currentKm; |
35 this.toDate = Long.MIN_VALUE; | 35 this.toDate = Long.MIN_VALUE; |
36 this.hasDate = false; | 36 this.hasDate = false; |
37 this.events = new int[0]; | 37 this.events = new int[0]; |
38 } | 38 } |
39 | 39 |
40 public void setRiver(String river) { | 40 public void setRiver(final String river) { |
41 this.river = river; | 41 this.river = river; |
42 } | 42 } |
43 | 43 |
44 public void setFromKm(double from) { | 44 public void setFromKm(final double from) { |
45 this.fromKm = from; | 45 this.fromKm = from; |
46 } | 46 } |
47 | 47 |
48 public void setToKm(double to) { | 48 public void setToKm(final double to) { |
49 this.toKm = to; | 49 this.toKm = to; |
50 } | 50 } |
51 | 51 |
52 public void setCurrentKm(double km) { | 52 public void setCurrentKm(final double km) { |
53 this.currentKm = km; | 53 this.currentKm = km; |
54 } | 54 } |
55 | 55 |
56 public void setFromClass(int from) { | 56 public void setFromClass(final int from) { |
57 this.fromClass = from; | 57 this.fromClass = from; |
58 } | 58 } |
59 | 59 |
60 public void setToClass(int to) { | 60 public void setToClass(final int to) { |
61 this.toClass = to; | 61 this.toClass = to; |
62 } | 62 } |
63 | 63 |
64 public void setFromDate(long from) { | 64 public void setFromDate(final long from) { |
65 this.hasDate = true; | 65 this.hasDate = true; |
66 this.fromDate = from; | 66 this.fromDate = from; |
67 } | 67 } |
68 | 68 |
69 public void setToDate(long to) { | 69 public void setToDate(final long to) { |
70 this.hasDate = true; | 70 this.hasDate = true; |
71 this.toDate = to; | 71 this.toDate = to; |
72 } | 72 } |
73 | 73 |
74 public void setEvents(int[] ev) { | 74 public void setEvents(final int[] ev) { |
75 this.events = ev; | 75 this.events = ev; |
76 } | 76 } |
77 | 77 |
78 public String getRiver() { | 78 public String getRiver() { |
79 return this.river; | 79 return this.river; |
80 } | 80 } |
81 | 81 |
82 public double getFromKm() { | 82 public double getLowerKm() { |
83 return this.fromKm; | 83 return Math.min(this.fromKm, this.toKm); |
84 } | 84 } |
85 | 85 |
86 public double getToKm() { | 86 public double getUpperKm() { |
87 return this.toKm; | 87 return Math.max(this.fromKm, this.toKm); |
88 } | 88 } |
89 | |
90 // public double getFromKm() { | |
91 // return this.fromKm; | |
92 // } | |
93 // | |
94 // public double getToKm() { | |
95 // return this.toKm; | |
96 // } | |
89 | 97 |
90 public double getCurrentKm() { | 98 public double getCurrentKm() { |
91 return this.currentKm; | 99 return this.currentKm; |
92 } | 100 } |
93 | 101 |
110 public int[] getEvents() { | 118 public int[] getEvents() { |
111 return this.events; | 119 return this.events; |
112 } | 120 } |
113 | 121 |
114 public boolean hasDate() { | 122 public boolean hasDate() { |
115 return fromDate != Long.MIN_VALUE && toDate != Long.MIN_VALUE; | 123 return this.fromDate != Long.MIN_VALUE && this.toDate != Long.MIN_VALUE; |
116 } | 124 } |
117 } | 125 } |
118 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 126 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |