# HG changeset patch # User kono # Date 1224120436 -32400 # Node ID b8efd57faf78a5f04f115f0df0c6aa60c8eede87 # Parent 59ef23ee73ada5d30413c59ea10aef45616444c7 *** empty log message *** diff -r 59ef23ee73ad -r b8efd57faf78 rep/channel/SelectorSimulator.java --- 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 keys() { Set newKeys = new HashSet(); for(SelectionKey k: keyList.values()) { - // REPSelectionKeyを生成しないように注意 newKeys.add(k); } return newKeys; } public Set> 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> newKeys = new HashSet>(); for(SelectionKeySimulator

k: keyList.values()) { - // REPSelectionKeyを生成しないように注意 - newKeys.add(k); //new SelectionKeySimulator

(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> selectedKeys1() { Set> newKeys = new HashSet>(); for(SelectionKeySimulator

k: selectedKeys) { - // REPSelectionKeyを生成しないように注意 - //newKeys.add(new SelectionKeySimulator

(k)); newKeys.add(k); } return newKeys; } + /* + * type safe copy of selectedKeys1() + */ @Override public Set selectedKeys() { - Set> keys = selectedKeys; Set newKeys = new HashSet(); - for(SelectionKeySimulator

k: keys) { - // REPSelectionKeyを生成しないように注意 - newKeys.add(k); // new SelectionKeySimulator

(k)); + for(SelectionKeySimulator

k: selectedKeys) { + newKeys.add(k); } return newKeys; }