comparison flys-client/src/main/java/org/dive4elements/river/client/shared/model/DoubleRangeData.java @ 5834:f507086aa94b

Repaired internal references.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:31:32 +0200
parents flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleRangeData.java@d0a9acddbea2
children 821a02bbfb4e
comparison
equal deleted inserted replaced
5833:a2bdc0f524e8 5834:f507086aa94b
1 package de.intevation.flys.client.shared.model;
2
3
4 public class DoubleRangeData implements RangeData {
5
6 public static final String TYPE = "doublerange";
7
8
9 protected String label;
10 protected String description;
11
12 protected double lower;
13 protected double upper;
14
15 protected Double defLower;
16 protected Double defUpper;
17
18
19 public DoubleRangeData() {
20 }
21
22
23 public DoubleRangeData(String label, String desc, double lower, double upper) {
24 this(label, desc, lower, upper, null, null);
25 }
26
27
28 public DoubleRangeData(
29 String label,
30 String desc,
31 double lower,
32 double upper,
33 Double defLower,
34 Double defUpper
35 ) {
36 this.label = label;
37 this.description = desc;
38 this.lower = lower;
39 this.upper = upper;
40 this.defLower = defLower;
41 this.defUpper = defUpper;
42 }
43
44
45 /**
46 * Returns the label of the item.
47 *
48 * @return the label.
49 */
50 public String getLabel() {
51 return label;
52 }
53
54
55 /**
56 * Returns the description of the item.
57 *
58 * @return the description.
59 */
60 public String getDescription() {
61 return description;
62 }
63
64
65 /**
66 * Returns the type of the item.
67 *
68 * @return the type.
69 */
70 public String getType() {
71 return "doublerange";
72 }
73
74
75 /**
76 * Returns a DataItem which value is a string that consists of the min and
77 * max value separated by a ';'.
78 *
79 * @return the DataItem.
80 */
81 public DataItem[] getItems() {
82 String theMin = String.valueOf(lower);
83 String theMax = String.valueOf(upper);
84
85 String label = theMin + " - " + theMax;
86 String value = theMin + ";" + theMax;
87
88 DataItem item = new DefaultDataItem(label, label, value);
89
90 return new DataItem[] { item };
91 }
92
93
94 /**
95 * @return always null.
96 */
97 public DataItem getDefault() {
98 return null;
99 }
100
101
102 public Object getLower() {
103 return lower;
104 }
105
106
107 public Object getUpper() {
108 return upper;
109 }
110
111
112 public Object getDefaultLower() {
113 return defLower;
114 }
115
116
117 public Object getDefaultUpper() {
118 return defUpper;
119 }
120
121
122 /**
123 * Returns the values as colon separated string.
124 *
125 * @return colon separated string.
126 */
127 public String getStringValue() {
128 String data = lower + ";" + upper;
129 return data;
130 }
131
132 }
133 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org