comparison flys-client/src/main/java/org/dive4elements/river/client/shared/model/OutputSettings.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/OutputSettings.java@bb5edff31866
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 import java.util.List;
5 import java.util.ArrayList;
6
7 /**
8 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
9 */
10 public class OutputSettings implements Settings, Cloneable {
11
12 /** The output name. */
13 protected String name;
14
15 /** The categories and settings container. */
16 protected HashMap<String, List<Property> > categories;
17
18
19 public OutputSettings() {
20 this.categories = new HashMap<String, List<Property> >();
21 }
22
23
24 public OutputSettings(String name) {
25 this.name = name;
26 this.categories = new HashMap<String, List<Property> >();
27 }
28
29
30 /** Set output name. */
31 public void setName(String name) {
32 this.name = name;
33 }
34
35
36 /** Get output name. */
37 public String getName() {
38 return this.name;
39 }
40
41
42 public void setSettings(String category, List<Property> settings) {
43 if (this.categories == null) {
44 this.categories = new HashMap<String, List<Property> >();
45 }
46 this.categories.put(category, settings);
47 }
48
49
50 public List<Property> getSettings(String category) {
51 return categories.get(category);
52 }
53
54
55 public List<String> getCategories() {
56 ArrayList<String> list = new ArrayList<String>(categories.keySet());
57 return list;
58 }
59
60
61 public Object clone() {
62 OutputSettings clone = new OutputSettings(this.getName());
63 for (String s: this.getCategories()) {
64 ArrayList cloneList = new ArrayList<Property>();
65 for(Property p: this.getSettings(s)) {
66 cloneList.add((Property)p.clone());
67 }
68 clone.setSettings(s, cloneList);
69 }
70 return clone;
71 }
72 }
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
74

http://dive4elements.wald.intevation.org