annotate rep/Session.java @ 3:f31fcac5a949

*** empty log message ***
author pin
date Fri, 06 Apr 2007 02:39:03 +0900
parents 02fa9a68d9a2
children 2d4c2c19d2d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
1 package rep;
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
2
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
3 import java.nio.channels.SocketChannel;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
4 import java.util.LinkedList;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
5 import java.util.List;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
6
0
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
7 public class Session {
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
8 Editor masterEditor;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
9 private int sessionID;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
10 private String sessionName;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
11 private LinkedList<Editor> editorList = new LinkedList<Editor>();
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
12 public Session(int sessionID, String string, SocketChannel channel) {
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
13 masterEditor = new Editor(sessionID, channel);
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
14 this.sessionID = sessionID;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
15 this.sessionName = string;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
16 }
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
17 public void addEditor(int editorID, SocketChannel channel) {
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
18 editorList.add(new Editor(editorID, channel));
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
19 }
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
20 public LinkedList getEditorList() {
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
21 return editorList;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
22 }
3
f31fcac5a949 *** empty log message ***
pin
parents: 2
diff changeset
23 public String toString(){
f31fcac5a949 *** empty log message ***
pin
parents: 2
diff changeset
24 return sessionName;
f31fcac5a949 *** empty log message ***
pin
parents: 2
diff changeset
25 }
0
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
26 }