comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/IntegerOptionsData.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/shared/model/IntegerOptionsData.java@821a02bbfb4e
children 172338b1407f
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.client.shared.model;
2
3
4 /** Data matching to labelled integer(s). */
5 public class IntegerOptionsData implements Data {
6
7 public static final String TYPE = "intoptions";
8
9 protected String label;
10 protected String description;
11
12 public DataItem[] opts;
13
14
15 public IntegerOptionsData() {
16 }
17
18
19 public IntegerOptionsData(String label, String desc, DataItem[] opts) {
20 this.label = label;
21 this.description = desc;
22 this.opts = opts;
23 }
24
25
26 /**
27 * Returns the label of the item.
28 *
29 * @return the label.
30 */
31 public String getLabel() {
32 return label;
33 }
34
35
36 /**
37 * Returns the description of the item.
38 *
39 * @return the description.
40 */
41 public String getDescription() {
42 return description;
43 }
44
45
46 /**
47 * Returns the type of the item.
48 *
49 * @return the type.
50 */
51 public String getType() {
52 return TYPE;
53 }
54
55
56 /**
57 * Returns the data items which represent the allowed options for this Data.
58 *
59 * @return the allowed options as DataItem array.
60 */
61 public DataItem[] getItems() {
62 return opts;
63 }
64
65
66 /**
67 * @return always null.
68 */
69 public DataItem getDefault() {
70 return null;
71 }
72
73
74 /**
75 * Returns the values as colon separated string.
76 *
77 * @return colon separated string.
78 */
79 public String getStringValue() {
80 String data = "";
81 boolean first = true;
82 for (int i = 0; i < opts.length; i++) {
83 if (!first) {
84 data += ";";
85 }
86 data += opts[i].getStringValue();
87 first = false;
88 }
89 return data;
90 }
91 }
92 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
93

http://dive4elements.wald.intevation.org