Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/transitions/DefaultTransition.java @ 106:5864c41219db
Initializes a TransitionEngine storing all transitions for each artifact at the application start.
flys-artifacts/trunk@1288 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 03 Feb 2011 10:23:30 +0000 |
parents | |
children | a228b39494a9 |
comparison
equal
deleted
inserted
replaced
105:beb991dc4827 | 106:5864c41219db |
---|---|
1 package de.intevation.flys.artifacts.transitions; | |
2 | |
3 import de.intevation.flys.artifacts.states.State; | |
4 | |
5 /** | |
6 * The default implementation of a <code>Transition</code>. | |
7 * | |
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
9 */ | |
10 public class DefaultTransition implements Transition { | |
11 | |
12 /** The ID of the current state */ | |
13 protected String from; | |
14 | |
15 /** The ID of the target state */ | |
16 protected String to; | |
17 | |
18 | |
19 /** | |
20 * The default constructor. | |
21 */ | |
22 public DefaultTransition() { | |
23 } | |
24 | |
25 | |
26 /** | |
27 * The default constructor. | |
28 * | |
29 * @param from The current state. | |
30 * @param to The target state. | |
31 */ | |
32 public DefaultTransition(String from, String to) { | |
33 this.from = from; | |
34 this.to = to; | |
35 } | |
36 | |
37 | |
38 /** | |
39 * Returns the current state ID. | |
40 * | |
41 * @return the current state ID. | |
42 */ | |
43 public String getFrom() { | |
44 return from; | |
45 } | |
46 | |
47 | |
48 /** | |
49 * Returns the target state ID. | |
50 * | |
51 * @return the target state ID. | |
52 */ | |
53 public String getTo() { | |
54 return to; | |
55 } | |
56 | |
57 | |
58 /** | |
59 * Set the current state ID. | |
60 * | |
61 * @param to the current state ID. | |
62 */ | |
63 public void setFrom(String from) { | |
64 this.from = from; | |
65 } | |
66 | |
67 | |
68 /** | |
69 * Set the target state ID. | |
70 * | |
71 * @param to the target state ID. | |
72 */ | |
73 public void setTo(String to) { | |
74 this.to = to; | |
75 } | |
76 | |
77 | |
78 /** | |
79 * This method always returns <i>true</i>. | |
80 * | |
81 * @param state The target state. | |
82 * | |
83 * @return true. | |
84 */ | |
85 public boolean isValid(State state) { | |
86 return true; | |
87 } | |
88 } | |
89 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |