01: /*
02: * Jacareto Copyright (c) 2002-2005
03: * Applied Computer Science Research Group, Darmstadt University of
04: * Technology, Institute of Mathematics & Computer Science,
05: * Ludwigsburg University of Education, and Computer Based
06: * Learning Research Group, Aachen University. All rights reserved.
07: *
08: * Jacareto is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * Jacareto is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public
19: * License along with Jacareto; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: package jacareto.cleverphl.session;
25:
26: import java.util.Iterator;
27: import java.util.Vector;
28:
29: /**
30: * Every session has a type which is represented by this class.
31: *
32: * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
33: * @version 1.00
34: */
35: public class SessionType {
36: /** The type where all functionality is given */
37: public static final SessionType COMPLETE = new SessionType(-1);
38:
39: /** The type where only the necessary functionality is given. */
40: public static final SessionType SIMPLE = new SessionType(1);
41:
42: /** The type for creating demonstrations. */
43: public static final SessionType DEMONSTRATION = new SessionType(2);
44:
45: /** The type for GUI testing. */
46: public static final SessionType GUI_TESTING = new SessionType(4);
47:
48: /** The type for empirical applications. */
49: public static final SessionType EMPIRICAL = new SessionType(8);
50:
51: /** The type for debug. */
52: public static final SessionType DEBUG = new SessionType(16);
53:
54: /** The vector of all types. */
55: private static Vector allTypes;
56:
57: static {
58: allTypes = new Vector(5, 5);
59: allTypes.add(COMPLETE);
60: allTypes.add(SIMPLE);
61: allTypes.add(DEMONSTRATION);
62: allTypes.add(GUI_TESTING);
63: allTypes.add(EMPIRICAL);
64: allTypes.add(DEBUG);
65: }
66:
67: /** The number identifying the type. */
68: private int id;
69:
70: /**
71: * Creates a new session type with the given id.
72: *
73: * @param id DOCUMENT ME!
74: */
75: public SessionType(int id) {
76: this .id = id;
77: }
78:
79: /**
80: * Returns the id of the type.
81: *
82: * @return DOCUMENT ME!
83: */
84: public int getID() {
85: return id;
86: }
87:
88: /**
89: * Returns an interator on all types.
90: *
91: * @return DOCUMENT ME!
92: */
93: public static Iterator types() {
94: return allTypes.iterator();
95: }
96: }
|