1
|
1 package rep;
|
|
2
|
|
3 import java.nio.channels.SocketChannel;
|
|
4
|
|
5 public class Editor {
|
23
|
6 private int eid;
|
1
|
7 private SocketChannel channel;
|
2
|
8 private SocketChannel nextChannel;
|
21
|
9 private String host;
|
|
10 private String port;
|
23
|
11 //public int getEID;
|
39
|
12 private String file;
|
1
|
13
|
|
14 public Editor(int editorNo, SocketChannel channel){
|
23
|
15 this.eid = editorNo;
|
1
|
16 this.channel = channel;
|
|
17 }
|
|
18
|
|
19 public SocketChannel getChannel() {
|
|
20 return channel;
|
|
21 }
|
21
|
22
|
|
23 public void setHost(String host){
|
|
24 this.host = host;
|
|
25 }
|
|
26 public void setPort(String port){
|
|
27 this.port = port;
|
|
28 }
|
|
29
|
|
30 public String getHost(){
|
|
31 return host;
|
|
32 }
|
|
33 public String getPort(){
|
|
34 return port;
|
|
35 }
|
|
36
|
23
|
37 public int getEID() {
|
|
38 return eid;
|
|
39 }
|
|
40
|
|
41 public void setEID(int eid) {
|
|
42 this.eid = eid;
|
|
43 }
|
24
|
44 public String toString(){
|
|
45 return ("eid:" + eid + ":" + channel.socket().getLocalSocketAddress().toString());
|
|
46 }
|
23
|
47
|
38
|
48 public String getName() {
|
39
|
49 return file;
|
|
50 }
|
|
51
|
|
52 public void setName(String string) {
|
|
53 file = string;
|
38
|
54 }
|
|
55
|
1
|
56 }
|