Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/PropertySetting.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/PropertySetting.java@821a02bbfb4e |
children | 172338b1407f |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.client.shared.model; | |
2 | |
3 import java.util.ArrayList; | |
4 import java.util.HashMap; | |
5 import java.util.List; | |
6 | |
7 /** | |
8 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
9 */ | |
10 public class PropertySetting implements Property, Cloneable { | |
11 | |
12 /**The settings name.*/ | |
13 protected String name; | |
14 | |
15 /** The default value.*/ | |
16 protected String value; | |
17 | |
18 /** Additional attributes.*/ | |
19 protected HashMap<String, String> attributes; | |
20 | |
21 /** | |
22 * Create a new StyleSetting for theme attribution. | |
23 */ | |
24 public PropertySetting() { | |
25 this.attributes = new HashMap<String, String>(); | |
26 } | |
27 | |
28 | |
29 /** | |
30 * Create a new PropertySet. | |
31 * @param name The attribute name. | |
32 * @param value The current value. | |
33 */ | |
34 public PropertySetting( | |
35 String name, | |
36 String value) | |
37 { | |
38 this.name = name; | |
39 this.value = value; | |
40 this.attributes = new HashMap<String, String>(); | |
41 } | |
42 | |
43 public void setName(String name) { | |
44 this.name = name; | |
45 } | |
46 | |
47 public void setValue(String value) { | |
48 this.value = value; | |
49 } | |
50 | |
51 public void setAttribute(String k, String v) { | |
52 attributes.put(k, v); | |
53 } | |
54 | |
55 public String getName() { | |
56 return this.name; | |
57 } | |
58 | |
59 public Object getValue() { | |
60 return this.value; | |
61 } | |
62 | |
63 public String getAttribute(String key) { | |
64 return attributes.get(key); | |
65 } | |
66 | |
67 public List<String> getAttributeList() { | |
68 return new ArrayList<String>(attributes.keySet()); | |
69 } | |
70 | |
71 @Override | |
72 public Object clone() { | |
73 PropertySetting clone = new PropertySetting(this.getName(), | |
74 this.getValue().toString()); | |
75 for(String s: this.getAttributeList()) { | |
76 clone.setAttribute(s, this.getAttribute(s)); | |
77 } | |
78 return clone; | |
79 } | |
80 } | |
81 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |