annotate rep/EditorPlus.java @ 356:b18c24dcc5d2

Before chaning put/join scheme for ditributed select.
author kono
date Sat, 18 Oct 2008 19:01:40 +0900
parents ef4afcae0c92
children fa041bae35f1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
1 package rep;
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
2
126
291c62984ba0 *** empty log message ***
kono
parents: 8
diff changeset
3 import rep.channel.REPSocketChannel;
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
4
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
5 public class EditorPlus {
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
6
356
b18c24dcc5d2 Before chaning put/join scheme for ditributed select.
kono
parents: 349
diff changeset
7 public int eid; // globally unique
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
8 public int sid=-1; // globally unique
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
9 public String host;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
10 public String file;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
11 public REPSocketChannel<REPCommand> channel;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
12
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
13 public EditorPlus() {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
14
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
15 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
16
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
17 public EditorPlus(int eid, REPSocketChannel<REPCommand> channel) {
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
18 this.eid = eid;
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
19 this.channel = channel;
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
20 }
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
21
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
22 public String getName() {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
23 return file;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
24 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
25
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
26 public void setName(String string) {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
27 file = string;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
28 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
29
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
30
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
31 public void setSID(int sid) {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
32 this.sid = sid;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
33 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
34
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
35 public int getSID() {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
36 return sid;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
37 }
324
e235998427a6 try to fix merger
kono
parents: 319
diff changeset
38
e235998427a6 try to fix merger
kono
parents: 319
diff changeset
39 public boolean hasSession() {
e235998427a6 try to fix merger
kono
parents: 319
diff changeset
40 return sid != -1;
e235998427a6 try to fix merger
kono
parents: 319
diff changeset
41 }
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
42
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
43 public String toString(){
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
44 return ("Editor:" + eid);
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
45 }
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
46
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
47 public void setEID(int eid) {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
48 this.eid = eid;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
49 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
50
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
51 public int getEID(){
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
52 return eid;
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
53 }
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
54
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
55 public void setHost(String host){
349
ef4afcae0c92 now Forwarder associates each client channel.
kono
parents: 324
diff changeset
56 if (channel!=null)
ef4afcae0c92 now Forwarder associates each client channel.
kono
parents: 324
diff changeset
57 this.host = host;
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
58 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
59
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
60
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
61 public String getHost(){
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
62 return host;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
63 }
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
64 public REPSocketChannel<REPCommand> getChannel(){
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
65 return channel;
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
66
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
67 }
319
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
68 public void setChannel(REPSocketChannel<REPCommand> channel) {
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
69 this.channel = channel;
dfed28488274 *** empty log message ***
kono
parents: 126
diff changeset
70 }
8
b774b87cc2c1 *** empty log message ***
pin
parents:
diff changeset
71 }