Mercurial > dive4elements > river
comparison flys-client/src/main/java/org/dive4elements/river/client/shared/model/IntegerOptionsData.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/IntegerOptionsData.java@887d7001eeec |
children | 821a02bbfb4e |
comparison
equal
deleted
inserted
replaced
5833:a2bdc0f524e8 | 5834:f507086aa94b |
---|---|
1 package de.intevation.flys.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 |