Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/AbstractStaticStateArtifact.java @ 4157:44d27b8bb0bc
Store a StaticState class in staticstate member variable
To be able to access StaticState methods we need a StaticState calls instead of
a State here.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 16 Oct 2012 15:47:36 +0200 |
parents | 4e1b3b4ef132 |
children | a699d6c42a8b |
comparison
equal
deleted
inserted
replaced
4156:529d0e61e70d | 4157:44d27b8bb0bc |
---|---|
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.List; | 4 import java.util.List; |
5 | 5 |
6 import de.intevation.artifactdatabase.state.State; | 6 import de.intevation.artifactdatabase.state.State; |
7 | |
8 import de.intevation.flys.artifacts.states.StaticState; | |
7 | 9 |
8 /** | 10 /** |
9 * A abstract baseclass for Artifacts which are using only one static state. | 11 * A abstract baseclass for Artifacts which are using only one static state. |
10 * | 12 * |
11 * This class is intended to be used without the config/stateengine to generate | 13 * This class is intended to be used without the config/stateengine to generate |
13 * | 15 * |
14 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | 16 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
15 */ | 17 */ |
16 public abstract class AbstractStaticStateArtifact extends StaticFLYSArtifact { | 18 public abstract class AbstractStaticStateArtifact extends StaticFLYSArtifact { |
17 | 19 |
18 private transient State staticstate; | 20 private transient StaticState staticstate; |
19 | 21 |
20 /** | 22 /** |
21 * Get a list containing the one and only State. | 23 * Get a list containing the one and only State. |
22 * @param context ignored. | 24 * @param context ignored. |
23 * @return list with one and only state. | 25 * @return list with one and only state. |
43 /** | 45 /** |
44 * A child class must override this method to set its static state | 46 * A child class must override this method to set its static state |
45 */ | 47 */ |
46 protected abstract void initStaticState(); | 48 protected abstract void initStaticState(); |
47 | 49 |
48 protected void setStaticState(State state) { | 50 protected void setStaticState(StaticState state) { |
49 this.staticstate = state; | 51 this.staticstate = state; |
50 } | 52 } |
51 | 53 |
52 protected State getStaticState() { | 54 protected StaticState getStaticState() { |
53 if (staticstate == null) { | 55 if (staticstate == null) { |
54 initStaticState(); | 56 initStaticState(); |
55 } | 57 } |
56 return staticstate; | 58 return staticstate; |
57 } | 59 } |