Map socketOwner = new HashMap();
Map<Socket, Future<String>> socketOwner = new HashMap<Socket, Future<String>>();
public class SocketUserMap extends HashMap<Socket<Future<String>> { } SocketUserMap socketOwner = new SocketUserMap(); // Define a type called "callback" that is a function pointer typedef void (*Callback)(int); void doSomething(Callback callback) { } // This function conforms to the type defined by Callback void callbackFunction(int arg) { } // So a caller can pass the address of callbackFunction to doSomething void useCallback() { doSomething(&callbackFunction); } class StringList extends ArrayList<String> { } class UserList extends ArrayList<String> { } ... class SomeClass { public void validateUsers(UserList users) { ... } public UserList lookupAll(StringList names) { ... }
新闻热点
疑难解答