comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/IntegerProperty.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/IntegerProperty.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.HashMap;
4
5 /**
6 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
7 */
8 public class IntegerProperty extends PropertySetting {
9
10 /**
11 * Create a new IntegerProperty for settings.
12 */
13 public IntegerProperty() {
14 this.attributes = new HashMap<String, String>();
15 }
16
17
18 /**
19 * Create a new IntegerProperty.
20 * @param name The attribute name.
21 * @param value The current value.
22 */
23 public IntegerProperty(
24 String name,
25 Integer value)
26 {
27 this.name = name;
28 this.value = value.toString();
29 this.attributes = new HashMap<String, String>();
30 }
31
32
33 @Override
34 public Integer getValue() {
35 try {
36 return Integer.valueOf(this.value);
37 }
38 catch(NumberFormatException nfe) {
39 return null;
40 }
41 }
42
43
44 public void setValue(Integer value) {
45 this.value = value.toString();
46 }
47
48 public Object clone() {
49 IntegerProperty clone = new IntegerProperty(this.getName(),
50 this.getValue());
51 for(String s: this.getAttributeList()) {
52 clone.setAttribute(s, this.getAttribute(s));
53 }
54 return clone;
55 }
56
57 }

http://dive4elements.wald.intevation.org