1
2
3
4
5
6
7 package org.state4j.sm;
8
9
10 /***
11 * @author andrea
12 *
13 */
14 public class SmSimpleStateImpl extends SmStateImpl implements SmSimpleState {
15
16 public SmState closeDownState() {
17 return this;
18 }
19
20 public boolean containsState(SmState state) {
21 return false;
22 }
23
24 public boolean deepContainsState(SmState state) {
25 return false;
26 }
27
28 public void deepEntry(SmContext cntx, SmState state) {
29 if(this.equals(state)) {
30 this.entry(cntx);
31 } else {
32 throw new RuntimeException("Sorry!! cannot deepEntry from " + this.getName() + "; state=" + state.getName());
33 }
34 }
35
36 public void deepExit(SmContext cntx, SmState state) {
37 if(this.equals(state)) {
38 this.exit(cntx);
39 } else {
40 throw new RuntimeException("Sorry!! cannot deepExit from " + this.getName() + "; state=" + state.getName());
41 }
42 }
43
44
45 }