annotate rep/Editor.java @ 39:c873ee0318f8

*** empty log message ***
author pin
date Sat, 10 Nov 2007 21:06:18 +0900
parents de8638eb0edd
children 6ead43b2475e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
1 package rep;
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
2
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
3 import java.nio.channels.SocketChannel;
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
4
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
5 public class Editor {
23
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
6 private int eid;
1
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
7 private SocketChannel channel;
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
8 private SocketChannel nextChannel;
21
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
9 private String host;
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
10 private String port;
23
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
11 //public int getEID;
39
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
12 private String file;
1
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
13
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
14 public Editor(int editorNo, SocketChannel channel){
23
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
15 this.eid = editorNo;
1
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
16 this.channel = channel;
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
17 }
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
18
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
19 public SocketChannel getChannel() {
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
20 return channel;
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
21 }
21
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
22
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
23 public void setHost(String host){
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
24 this.host = host;
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
25 }
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
26 public void setPort(String port){
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
27 this.port = port;
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
28 }
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
29
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
30 public String getHost(){
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
31 return host;
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
32 }
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
33 public String getPort(){
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
34 return port;
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
35 }
2d4bab638a71 *** empty log message ***
pin
parents: 2
diff changeset
36
23
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
37 public int getEID() {
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
38 return eid;
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
39 }
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
40
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
41 public void setEID(int eid) {
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
42 this.eid = eid;
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
43 }
24
7012a944e58f *** empty log message ***
pin
parents: 23
diff changeset
44 public String toString(){
7012a944e58f *** empty log message ***
pin
parents: 23
diff changeset
45 return ("eid:" + eid + ":" + channel.socket().getLocalSocketAddress().toString());
7012a944e58f *** empty log message ***
pin
parents: 23
diff changeset
46 }
23
01657c033761 *** empty log message ***
pin
parents: 21
diff changeset
47
38
de8638eb0edd *** empty log message ***
pin
parents: 24
diff changeset
48 public String getName() {
39
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
49 return file;
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
50 }
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
51
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
52 public void setName(String string) {
c873ee0318f8 *** empty log message ***
pin
parents: 38
diff changeset
53 file = string;
38
de8638eb0edd *** empty log message ***
pin
parents: 24
diff changeset
54 }
de8638eb0edd *** empty log message ***
pin
parents: 24
diff changeset
55
1
3f5bf0255f5e *** empty log message ***
pin
parents:
diff changeset
56 }