diff rep/channel/SelectorSimulator.java @ 197:8d7c74610b05

*** empty log message ***
author kent
date Sat, 30 Aug 2008 00:00:51 +0900
parents be219ba8b39c
children 4c0a94836357
line wrap: on
line diff
--- a/rep/channel/SelectorSimulator.java	Fri Aug 29 21:39:13 2008 +0900
+++ b/rep/channel/SelectorSimulator.java	Sat Aug 30 00:00:51 2008 +0900
@@ -41,11 +41,11 @@
 		return selectedKeys.size();
 	}
 
-	public SelectionKeySimulator register(SelectableChannel cs, int opt){
+	public SelectionKeySimulator<P> register(SelectableChannel cs, int opt){
 		return register(cs, opt, null);
 	}
-	public SelectionKeySimulator register(SelectableChannel cs, int opt, Object handler){
-		SelectionKeySimulator key = new SelectionKeySimulator(cs, opt, this);
+	public SelectionKeySimulator<P> register(SelectableChannel cs, int opt, Object handler){
+		SelectionKeySimulator<P> key = new SelectionKeySimulator<P>(cs, opt, this);
 		key.attach(handler);
 		keyList.add(key);
 		return key;
@@ -54,11 +54,12 @@
 
 	public Set<REPSelectionKey<P>> selectedKeys1() {
 			Set<SelectionKey> keys = keyList;
-			HashSet<REPSelectionKey<P>> newKeys = new HashSet<REPSelectionKey<P>>();
+			Set<REPSelectionKey<P>> newKeys = new HashSet<REPSelectionKey<P>>();
 			for(SelectionKey k: keys) {
-				newKeys.add(new REPSelectionKey<P>(k));
+				// REPSelectionKeyを生成しないように注意
+				newKeys.add(new SelectionKeySimulator<P>(k));
 			}
-			return (Set<REPSelectionKey<P>>)newKeys;
+			return newKeys;//(Set<REPSelectionKey<P>>)newKeys;
 	}
 	
 	/*