KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > entity > TraditionalAutomaticNodeState


1 package hero.entity;
2 import hero.interfaces.BnNodeLocal;
3 import hero.interfaces.Constants;
4
5 public class TraditionalAutomaticNodeState extends NodeState implements java.io.Serializable JavaDoc {
6
7
8     private static int[][] nodeTransition= {
9     {
10         Constants.Nd.BAD_TRANSITION, // START, INITIAL
11
Constants.Nd.TERMINATED, // START, READY
12
Constants.Nd.BAD_TRANSITION, // START, DEAD
13
Constants.Nd.BAD_TRANSITION, // START, ANTICIPABLE
14
Constants.Nd.BAD_TRANSITION, // START, EXPIRED
15
Constants.Nd.BAD_TRANSITION, // START, ANTICIPATING
16
Constants.Nd.BAD_TRANSITION, // START, EXECUTING
17
Constants.Nd.BAD_TRANSITION, // START, EXECUTED
18
Constants.Nd.BAD_TRANSITION, // START, INERROR
19
Constants.Nd.BAD_TRANSITION, // START, FINISHED
20
Constants.Nd.BAD_TRANSITION, // START, TERMINATED
21
Constants.Nd.BAD_TRANSITION, // START, CHECKEDOUT
22
Constants.Nd.BAD_TRANSITION, // START, ANT_SUSPENDED
23
Constants.Nd.BAD_TRANSITION, // START, EXEC_SUSPENDED
24
},{
25         Constants.Nd.BAD_TRANSITION, // TERMINATE, INITIAL
26
Constants.Nd.BAD_TRANSITION, // TERMINATE, READY
27
Constants.Nd.BAD_TRANSITION, // TERMINATE, DEAD
28
Constants.Nd.BAD_TRANSITION, // TERMINATE, ANTICIPABLE
29
Constants.Nd.BAD_TRANSITION, // TERMINATE, EXPIRED
30
Constants.Nd.BAD_TRANSITION, // TERMINATE, ANTICIPATING
31
Constants.Nd.TERMINATED, // TERMINATE, EXECUTING
32
Constants.Nd.BAD_TRANSITION, // TERMINATE, EXECUTED
33
Constants.Nd.BAD_TRANSITION, // TERMINATE, INERROR
34
Constants.Nd.BAD_TRANSITION, // TERMINATE, FINISHED
35
Constants.Nd.BAD_TRANSITION, // TERMINATE, TERMINATED
36
Constants.Nd.BAD_TRANSITION, // TERMINATE, CHECKEDOUT
37
Constants.Nd.BAD_TRANSITION, // TERMINATE, ANT_SUSPENDED
38
Constants.Nd.BAD_TRANSITION, // TERMINATE, EXEC_SUSPENDED
39
},{
40         Constants.Nd.BAD_TRANSITION, // SUSPEND, INITIAL
41
Constants.Nd.BAD_TRANSITION, // SUSPEND, READY
42
Constants.Nd.BAD_TRANSITION, // SUSPEND, DEAD
43
Constants.Nd.BAD_TRANSITION, // SUSPEND, ANTICIPABLE
44
Constants.Nd.BAD_TRANSITION, // SUSPEND, EXPIRED
45
Constants.Nd.BAD_TRANSITION, // SUSPEND, ANTICIPATING
46
Constants.Nd.BAD_TRANSITION, // SUSPEND, EXECUTING
47
Constants.Nd.BAD_TRANSITION, // SUSPEND, EXECUTED
48
Constants.Nd.BAD_TRANSITION, // SUSPEND, INERROR
49
Constants.Nd.BAD_TRANSITION, // SUSPEND, FINISHED
50
Constants.Nd.BAD_TRANSITION, // SUSPEND, TERMINATED
51
Constants.Nd.BAD_TRANSITION, // SUSPEND, CHECKEDOUT
52
Constants.Nd.BAD_TRANSITION, // SUSPEND, ANT_SUSPENDED
53
Constants.Nd.BAD_TRANSITION, // SUSPEND, EXEC_SUSPENDED
54
},{
55         Constants.Nd.BAD_TRANSITION, // RESUME, INITIAL
56
Constants.Nd.BAD_TRANSITION, // RESUME, READY
57
Constants.Nd.BAD_TRANSITION, // RESUME, DEAD
58
Constants.Nd.BAD_TRANSITION, // RESUME, ANTICIPABLE
59
Constants.Nd.BAD_TRANSITION, // RESUME, EXPIRED
60
Constants.Nd.BAD_TRANSITION, // RESUME, ANTICIPATING
61
Constants.Nd.BAD_TRANSITION, // RESUME, EXECUTING
62
Constants.Nd.BAD_TRANSITION, // RESUME, EXECUTED
63
Constants.Nd.BAD_TRANSITION, // RESUME, INERROR
64
Constants.Nd.BAD_TRANSITION, // RESUME, FINISHED
65
Constants.Nd.BAD_TRANSITION, // RESUME, TERMINATED
66
Constants.Nd.BAD_TRANSITION, // RESUME, CHECKEDOUT
67
Constants.Nd.ANTICIPATING, // RESUME, ANT_SUSPENDED
68
Constants.Nd.EXECUTING, // RESUME, EXEC_SUSPENDED
69
},{
70         Constants.Nd.INITIAL, // EDGEINITIAL, INITIAL
71
Constants.Nd.INITIAL, // EDGEINITIAL, READY
72
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, DEAD
73
Constants.Nd.INITIAL, // EDGEINITIAL, ANTICIPABLE
74
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, EXPIRED
75
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, ANTICIPATING
76
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, EXECUTING
77
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, EXECUTED
78
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, INERROR
79
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, FINISHED
80
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, TERMINATED
81
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, CHECKEDOUT
82
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, ANT_SUSPENDED
83
Constants.Nd.BAD_TRANSITION, // EDGEINITIAL, EXEC_SUSPENDED
84
},{
85         Constants.Nd.INITIAL, // ANTACTIVE, INITIAL
86
Constants.Nd.INITIAL, // ANTACTIVE, READY
87
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, DEAD
88
Constants.Nd.INITIAL, // ANTACTIVE, ANTICIPABLE
89
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, EXPIRED
90
Constants.Nd.INITIAL, // ANTACTIVE, ANTICIPATING
91
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, EXECUTING
92
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, EXECUTED
93
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, INERROR
94
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, FINISHED
95
Constants.Nd.TERMINATED , // ANTACTIVE, TERMINATED
96
Constants.Nd.BAD_TRANSITION, // ANTACTIVE, CHECKEDOUT
97
Constants.Nd.INITIAL, // ANTACTIVE, ANT_SUSPENDED
98
Constants.Nd.INITIAL, // ANTACTIVE, EXEC_SUSPENDED
99
},{
100         Constants.Nd.TERMINATED, // ACTIVE, INITIAL
101
Constants.Nd.TERMINATED, // ACTIVE, READY
102
Constants.Nd.BAD_TRANSITION, // ACTIVE, DEAD
103
Constants.Nd.READY, // ACTIVE, ANTICIPABLE
104
Constants.Nd.BAD_TRANSITION, // ACTIVE, EXPIRED
105
Constants.Nd.BAD_TRANSITION, // ACTIVE, ANTICIPATING
106
Constants.Nd.TERMINATED, // ACTIVE, EXECUTING
107
Constants.Nd.BAD_TRANSITION, // ACTIVE, EXECUTED
108
Constants.Nd.BAD_TRANSITION, // ACTIVE, INERROR
109
Constants.Nd.BAD_TRANSITION, // ACTIVE, FINISHED
110
Constants.Nd.TERMINATED, // ACTIVE, TERMINATED
111
Constants.Nd.BAD_TRANSITION, // ACTIVE, CHECKEDOUT
112
Constants.Nd.EXEC_SUSPENDED, // ACTIVE, ANT_SUSPENDED
113
Constants.Nd.EXEC_SUSPENDED, // ACTIVE, EXEC_SUSPENDED
114
},{
115         Constants.Nd.DEAD, // CANCEL, INITIAL
116
Constants.Nd.DEAD, // CANCEL, READY
117
Constants.Nd.DEAD, // CANCEL, DEAD
118
Constants.Nd.DEAD, // CANCEL, ANTICIPABLE
119
Constants.Nd.BAD_TRANSITION, // CANCEL, EXPIRED
120
Constants.Nd.BAD_TRANSITION, // CANCEL, ANTICIPATING
121
Constants.Nd.DEAD, // CANCEL, EXECUTING
122
Constants.Nd.BAD_TRANSITION, // CANCEL, EXECUTED
123
Constants.Nd.BAD_TRANSITION, // CANCEL, INERROR
124
Constants.Nd.BAD_TRANSITION, // CANCEL, FINISHED
125
Constants.Nd.BAD_TRANSITION, // CANCEL, TERMINATED
126
Constants.Nd.BAD_TRANSITION, // CANCEL, CHECKEDOUT
127
Constants.Nd.DEAD, // CANCEL, ANT_SUSPENDED
128
Constants.Nd.DEAD, // CANCEL, EXEC_SUSPENDED
129
}
130     };
131
132     public TraditionalAutomaticNodeState() {
133     }
134
135     public int computeState(BnNodeLocal node,int operation) {
136     return nodeTransition[operation][node.getState()];
137     }
138     
139     
140 }
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Popular Tags