Mercurial > hg > RemoteEditor > REPSessionManager
annotate rep/EditorList.java @ 452:d0d2449000f5
checkAck
author | one |
---|---|
date | Thu, 23 Sep 2010 21:19:28 +0900 (2010-09-23) |
parents | 3b0a5a55e3ee |
children |
rev | line source |
---|---|
22 | 1 package rep; |
2 | |
358 | 3 import java.util.HashMap; |
23 | 4 |
391 | 5 import rep.channel.REPSocketChannel; |
382
4b87f89b3afd
REP Session Manager (Java version)
one@firefly.cr.ie.u-ryukyu.ac.jp
parents:
361
diff
changeset
|
6 import rep.handler.REPNode; |
4b87f89b3afd
REP Session Manager (Java version)
one@firefly.cr.ie.u-ryukyu.ac.jp
parents:
361
diff
changeset
|
7 |
4b87f89b3afd
REP Session Manager (Java version)
one@firefly.cr.ie.u-ryukyu.ac.jp
parents:
361
diff
changeset
|
8 public class EditorList extends HashMap<Integer,REPNode> { |
23 | 9 |
356 | 10 /** |
11 * | |
12 */ | |
13 private static final long serialVersionUID = 1L; | |
14 private int eid_root=0; | |
358 | 15 |
382
4b87f89b3afd
REP Session Manager (Java version)
one@firefly.cr.ie.u-ryukyu.ac.jp
parents:
361
diff
changeset
|
16 public void add(REPNode fw) { |
358 | 17 put(fw.getEID(),fw); |
22 | 18 } |
19 | |
31 | 20 |
356 | 21 public int newEid() { |
22 return ++eid_root; | |
76 | 23 } |
24 | |
85 | 25 |
358 | 26 |
27 public boolean hasEid(int eid) { | |
28 return containsKey(eid); | |
85 | 29 } |
30 | |
391 | 31 public REPNode editorByChannel(REPSocketChannel<REPCommand>channel) { |
32 for(REPNode e:this.values()) { | |
33 if (e.channel==channel) | |
34 return e; | |
35 } | |
36 return null; | |
37 } | |
22 | 38 } |