KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > StateHolder


1 package org.sapia.soto.state;
2
3
4 /**
5  * @author Yanick Duchesne
6  *
7  * <dl>
8  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
9  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
10  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
11  * </dl>
12  */

13 public class StateHolder {
14   private boolean _visible = true;
15   private State _state;
16
17   StateHolder(State state) {
18     _state = state;
19   }
20
21   /**
22    * @return <code>true</code> if the encapsulated <code>State</code> is visible
23    * - i.e.: can be called from outside the state machine.
24    */

25   public boolean isVisible() {
26     return _visible;
27   }
28
29   /**
30    * @return the <code>State</code> that this instance holds.
31    */

32   public State getState() {
33     return _state;
34   }
35
36   /**
37    * Sets this instance's state.
38    *
39    * @param state a <code>State</code>.
40    */

41   void setState(State state) {
42     _state = state;
43   }
44
45   /**
46    * @param visible <code></code>
47    */

48   void setVisible(boolean visible) {
49     _visible = visible;
50   }
51 }
52
Popular Tags