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 jacareto.system.Environment;
27:
28: /**
29: * This event will be delivered to session list listeners when the session list changes.
30: *
31: * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
32: * @version 0.9
33: */
34: public class SessionListEvent {
35: /** A session has been added to the list. */
36: public static final int SESSION_ADDED = 0;
37:
38: /** A session has been removed from the list. */
39: public static final int SESSION_REMOVED = 1;
40:
41: /** Another session has become the actual session. */
42: public static final int NEW_ACTUAL_SESSION = 2;
43:
44: /** The event type. */
45: private int ID;
46:
47: /** The session this event belongs to. */
48: private Session session;
49:
50: /** The Environment. */
51: private Environment env;
52:
53: /** The index of the session in the session list. */
54: private int index;
55:
56: /**
57: * Creates a session list event with the specified values.
58: *
59: * @param env the environment
60: * @param ID the ID of the event
61: * @param session the session this event belongs to
62: * @param index the index of the session in the session list
63: */
64: public SessionListEvent(Environment env, int ID, Session session,
65: int index) {
66: this .env = env;
67: this .ID = ID;
68: this .session = session;
69: this .index = index;
70: }
71:
72: /**
73: * Returns the type of the event.
74: *
75: * @return the type
76: */
77: public int getID() {
78: return ID;
79: }
80:
81: /**
82: * Returns the session this event belongs to.
83: *
84: * @return DOCUMENT ME!
85: */
86: public Session getSession() {
87: return session;
88: }
89:
90: /**
91: * Returns the index of the session in the session list. If the session has been removed, the
92: * returned value is the index of the session before it has been removed.
93: *
94: * @return DOCUMENT ME!
95: */
96: public int getIndex() {
97: return index;
98: }
99: }
|