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