comparison rep/EditorPlus.java @ 319:dfed28488274

*** empty log message ***
author kono
date Thu, 09 Oct 2008 17:26:55 +0900
parents 291c62984ba0
children e235998427a6
comparison
equal deleted inserted replaced
318:dc57e24ea3df 319:dfed28488274
1 package rep; 1 package rep;
2 2
3 import rep.channel.REPSocketChannel; 3 import rep.channel.REPSocketChannel;
4 4
5 public class EditorPlus<P> { 5 public class EditorPlus {
6 6
7 private int eid; 7 public int eid; // unique in a session, eid==0 master
8 private REPSocketChannel<P> channel; 8 public int sid=-1; // globally unique
9 public EditorPlus(int eid, REPSocketChannel<P> channel) { 9 public String host;
10 public String file;
11 public REPSocketChannel<REPCommand> channel;
12
13 public EditorPlus() {
14
15 }
16
17 public EditorPlus(int eid, REPSocketChannel<REPCommand> channel) {
10 this.eid = eid; 18 this.eid = eid;
11 this.channel = channel; 19 this.channel = channel;
12 } 20 }
21
22 public String getName() {
23 return file;
24 }
25
26 public void setName(String string) {
27 file = string;
28 }
29
30
31 public void setSID(int sid) {
32 this.sid = sid;
33 }
34
35 public int getSID() {
36 return sid;
37 }
38
13 public String toString(){ 39 public String toString(){
14 return ("Editor:" + eid); 40 return ("Editor:" + eid);
15 } 41 }
42
43 public void setEID(int eid) {
44 this.eid = eid;
45 }
46
16 public int getEID(){ 47 public int getEID(){
17 return eid; 48 return eid;
18 } 49 }
19 public REPSocketChannel<P> getChannel(){ 50
51 public void setHost(String host){
52 this.host = host;
53 }
54
55
56 public String getHost(){
57 return host;
58 }
59 public REPSocketChannel<REPCommand> getChannel(){
20 return channel; 60 return channel;
21 61
22 } 62 }
63 public void setChannel(REPSocketChannel<REPCommand> channel) {
64 this.channel = channel;
65 }
23 } 66 }