01: package hero.entity;
02:
03: /*
04: *
05: * EdgeState.java -
06: * Copyright (C) 2002 Ecoo Team
07: * charoy@loria.fr
08: *
09: *
10: * This program is free software; you can redistribute it and/or
11: * modify it under the terms of the GNU Lesser General Public License
12: * as published by the Free Software Foundation; either version 2
13: * of the License, or (at your option) any later version.
14: *
15: * This program is distributed in the hope that it will be useful,
16: * but WITHOUT ANY WARRANTY; without even the implied warranty of
17: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: * GNU Lesser General Public License for more details.
19: *
20: * You should have received a copy of the GNU Lesser General Public License
21: * along with this program; if not, write to the Free Software
22: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23: */
24:
25: import hero.interfaces.BnNodeLocal;
26:
27: public abstract class EdgeState implements java.io.Serializable {
28:
29: public static EdgeState make(int type) {
30: if (type == hero.interfaces.Constants.Nd.AND_JOIN_NODE) {
31: return new AndEdgeState();
32: }
33: if (type == hero.interfaces.Constants.Nd.OR_JOIN_NODE) {
34: return new OrEdgeState();
35: }
36: if (type == hero.interfaces.Constants.Nd.AND_JOIN_AUTOMATIC_NODE) {
37: return new AndEdgeState();
38: }
39: if (type == hero.interfaces.Constants.Nd.OR_JOIN_AUTOMATIC_NODE) {
40: return new OrEdgeState();
41: }
42:
43: return new AndEdgeState();
44: }
45:
46: public abstract int state(BnNodeLocal nd);
47:
48: }
|