annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java @ 1115:f953c9a559d8

Added license file and license headers. gnv-artifacts/trunk@1260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:46:55 +0000
parents 05bf8534a35a
children
rev   line source
1115
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
1 /*
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
3 *
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
5 * Read the file LGPL.txt coming with the software for details
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
7 */
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
8
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 package de.intevation.gnv.state.describedata;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11 /**
809
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
12 * This is the default implementation of <code>KeyValueDescibeData</code>. This
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
13 * class just implements the necessary methods and two constructors.
835
2423cefe7d39 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 809
diff changeset
14 *
780
c4156275c1e1 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 779
diff changeset
15 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 public class DefaultKeyValueDescribeData implements KeyValueDescibeData {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 private static final long serialVersionUID = -924469415242703108L;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 private String key;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 private String value = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
25 private String state;
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
26
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 private boolean selected = false;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28
809
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
29 /**
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
30 * Creates a new instance of this class with a key-value pair, but no state
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
31 * and no selection.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
32 *
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
33 * @param key The key.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
34 * @param value A value.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
35 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 public DefaultKeyValueDescribeData(String key, String value) {
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
37 this(key, value, null);
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
38 }
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
39
809
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
40 /**
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
41 * Creates a new instance of this class with a key-value pair and the state
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
42 * this object belongs to.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
43 *
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
44 * @param key The key.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
45 * @param value A value.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
46 * @param state A state.
d05b17a4f3d0 Added javadoc in describedata package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
47 */
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
48 public DefaultKeyValueDescribeData(String key, String value, String state) {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 super();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 this.key = key;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 this.value = value;
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
52 this.state = state;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 public String getKey() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 return this.key;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 public String getValue() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 return this.value;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
61 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 public boolean isSelected() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 return this.selected;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 public void setSelected(boolean selected) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
68 this.selected = selected;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
71 public String getState() {
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
72 return this.state;
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
73 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
74 }
836
05bf8534a35a Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 835
diff changeset
75 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org