weniger static

This commit is contained in:
Johannes Theiner 2018-06-07 18:22:10 +02:00
parent 2dd8cc4f39
commit cb37a78d60
1 changed files with 8 additions and 8 deletions

View File

@ -8,11 +8,16 @@ import java.util.concurrent.*;
public class KlausurenServer { public class KlausurenServer {
private ConcurrentMap<String, TreeSet<Integer>> data = new ConcurrentHashMap<>(); private ConcurrentMap<String, TreeSet<Integer>> data = new ConcurrentHashMap<>();
private static ExecutorService executorService = Executors.newCachedThreadPool(); private ExecutorService executorService = Executors.newCachedThreadPool();
private static ServerSocket serverSocket; private ServerSocket serverSocket;
private static Map<String, CommandHandler> commands = new HashMap<>(); private static Map<String, CommandHandler> commands = new HashMap<>();
static Map<String, CommandHandler> getCommands() {
return commands;
}
private boolean running; private boolean running;
public KlausurenServer(int port) { public KlausurenServer(int port) {
@ -50,10 +55,9 @@ public class KlausurenServer {
set.forEach((key, value) -> set.forEach((s, integers) -> { set.forEach((key, value) -> set.forEach((s, integers) -> {
if(!value.equals(integers)) { if(!value.equals(integers)) {
if (integers.containsAll(value)) { if (integers.containsAll(value))
set.remove(key); set.remove(key);
} }
}
})); }));
set.forEach((key, value) -> result.add(value)); set.forEach((key, value) -> result.add(value));
@ -159,10 +163,6 @@ public class KlausurenServer {
} }
} }
static Map<String, CommandHandler> getCommands() {
return commands;
}
public static void main(String[] args) { public static void main(String[] args) {
new KlausurenServer(Integer.parseInt(args[0])); new KlausurenServer(Integer.parseInt(args[0]));
} }