| 15 | import java.util.HashSet; |
| 16 | |
| 17 | public abstract class Selector { |
| 18 | protected final Set<SelectionKey> keys = new HashSet(); |
| 19 | protected final Set<SelectionKey> selectedKeys = new HashSet(); |
| 20 | |
| 21 | public static Selector open() throws IOException { |
| 22 | return new SocketSelector(); |
| 23 | } |
| 24 | |
| 25 | public void add(SelectionKey key) { |
| 26 | keys.add(key); |
| 27 | } |
| 28 | |
| 29 | public void remove(SelectionKey key) { |
| 30 | keys.remove(key); |
| 31 | } |
| 32 | |
| 33 | public Set<SelectionKey> keys() { |
| 34 | return keys; |
| 35 | } |
| 36 | |
| 37 | public Set<SelectionKey> selectedKeys() { |
| 38 | return selectedKeys; |
| 39 | } |
| 40 | |
| 41 | public abstract boolean isOpen(); |
| 42 | |
| 43 | public abstract Selector wakeup(); |
| 44 | |
| 45 | public abstract int selectNow() throws IOException; |
| 46 | |
| 47 | public abstract int select(long interval) throws IOException; |
| 48 | |
| 49 | public abstract int select() throws IOException; |
| 50 | |
| 51 | public abstract void close(); |
| 52 | } |
nothing calls this directly
no outgoing calls
no test coverage detected