MCPcopy Create free account
hub / github.com/ReadyTalk/avian / Selector

Class Selector

classpath/java/nio/channels/Selector.java:17–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15import java.util.HashSet;
16
17public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected