Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultArtifactDescription.java @ 12:fa0aad20af53
Adjusted interfaces used for the ArtifactDescription and added default implementations.
flys-client/trunk@1321 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 17 Feb 2011 08:31:33 +0000 |
parents | |
children | a2923d63f530 |
comparison
equal
deleted
inserted
replaced
11:6aeb4072eeb4 | 12:fa0aad20af53 |
---|---|
1 package de.intevation.flys.client.shared.model; | |
2 | |
3 | |
4 /** | |
5 * The default implementation of an {@link ArtifactDescription}. This class just | |
6 * implements constructors to create new instances and the necessary methods of | |
7 * the interface. | |
8 * | |
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
10 */ | |
11 public class DefaultArtifactDescription implements ArtifactDescription { | |
12 | |
13 /** Data that have been inserted in former states.*/ | |
14 protected Data[] oldData; | |
15 | |
16 /** The Data that is allowed to be inserted in the current state.*/ | |
17 protected Data currentData; | |
18 | |
19 /** The current state name.*/ | |
20 protected String currentState; | |
21 | |
22 /** The names of reachable states.*/ | |
23 protected String[] reachableStates; | |
24 | |
25 | |
26 public DefaultArtifactDescription() { | |
27 } | |
28 | |
29 | |
30 /** | |
31 * The default constructor. | |
32 * | |
33 * @param old The data that have been inserted in former states. | |
34 * @param current The data that might be inserted in the current state. | |
35 * @param state The name of the current state. | |
36 * @param reachableStates The names of the reachable states. | |
37 */ | |
38 public DefaultArtifactDescription( | |
39 Data[] old, Data current, String state, String[] reachableStates) | |
40 { | |
41 this.oldData = old; | |
42 this.currentData = current; | |
43 this.currentState = state; | |
44 this.reachableStates = reachableStates; | |
45 } | |
46 | |
47 | |
48 public Data[] getOldData() { | |
49 return oldData; | |
50 } | |
51 | |
52 | |
53 public Data getCurrentData() { | |
54 return currentData; | |
55 } | |
56 | |
57 | |
58 public String getCurrentState() { | |
59 return currentState; | |
60 } | |
61 | |
62 | |
63 public String[] getReachableStates() { | |
64 return reachableStates; | |
65 } | |
66 } | |
67 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |