Реферат: Java технологія и основні риси та перспективи застосування
send("quit " + id); // tell other player
out.println("quit");
stop();
}
private Thread t;
void start() {
t = new Thread(this);
t.start();
}
void stop() {
t.stop();
}
private static final int ID = 1;
private static final int ADD = 2;
private static final int DELETE = 3;
private static final int CHAT = 4;
private static final int QUIT = 5;
private static Hashtable keys = new Hashtable();
private static String keystrings[] = {
"", "id", "add", "delete","chat",
"quit"
};
static {
for (int i = 0; i < keystrings.length; i++)
keys.put(keystrings[i], new Integer(i));
}
private int lookup(String s) {
Integer i = (Integer) keys.get(s);
return i == null ? -1 : i.intValue();