Mercurial > hg > RemoteEditor > REPSessionManager
changeset 351:b8efd57faf78
*** empty log message ***
author | kono |
---|---|
date | Thu, 16 Oct 2008 10:27:16 +0900 |
parents | 59ef23ee73ad |
children | 39223c6ef689 |
files | rep/channel/SelectorSimulator.java |
diffstat | 1 files changed, 8 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/channel/SelectorSimulator.java Thu Oct 16 10:19:18 2008 +0900 +++ b/rep/channel/SelectorSimulator.java Thu Oct 16 10:27:16 2008 +0900 @@ -111,26 +111,23 @@ public Set<SelectionKey> keys() { Set<SelectionKey> newKeys = new HashSet<SelectionKey>(); for(SelectionKey k: keyList.values()) { - // REPSelectionKeyを生成しないように注意 newKeys.add(k); } return newKeys; } public Set<REPSelectionKey<P>> keys1() { - // we cannot solve cast, we need the same method again with different - // types + // we cannot solve cast, we need the same method again with different types Set<REPSelectionKey<P>> newKeys = new HashSet<REPSelectionKey<P>>(); for(SelectionKeySimulator<P> k: keyList.values()) { - // REPSelectionKeyを生成しないように注意 - newKeys.add(k); //new SelectionKeySimulator<P>(k)); + newKeys.add(k); } return newKeys; } @Override public SelectorProvider provider() { - // TODO Auto-generated method stub + // should return NetworkSimulator? return null; } @@ -145,20 +142,19 @@ public Set<REPSelectionKey<P>> selectedKeys1() { Set<REPSelectionKey<P>> newKeys = new HashSet<REPSelectionKey<P>>(); for(SelectionKeySimulator<P> k: selectedKeys) { - // REPSelectionKeyを生成しないように注意 - //newKeys.add(new SelectionKeySimulator<P>(k)); newKeys.add(k); } return newKeys; } + /* + * type safe copy of selectedKeys1() + */ @Override public Set<SelectionKey> selectedKeys() { - Set<SelectionKeySimulator<P>> keys = selectedKeys; Set<SelectionKey> newKeys = new HashSet<SelectionKey>(); - for(SelectionKeySimulator<P> k: keys) { - // REPSelectionKeyを生成しないように注意 - newKeys.add(k); // new SelectionKeySimulator<P>(k)); + for(SelectionKeySimulator<P> k: selectedKeys) { + newKeys.add(k); } return newKeys; }