public class NioSelectedKeySet extends AbstractSet<SelectionKey>
Selector
.
Assumes single threaded usage.Constructor and Description |
---|
NioSelectedKeySet()
Construct a key set with default capacity
|
NioSelectedKeySet(int initialCapacity)
Construct a key set with the given capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(SelectionKey selectionKey) |
int |
capacity()
Capacity of the current set
|
boolean |
contains(Object o) |
int |
forEach(ToIntFunction<SelectionKey> function)
Iterate over the key set and apply the given function.
|
Iterator<SelectionKey> |
iterator() |
SelectionKey[] |
keys()
Return selected keys.
|
boolean |
remove(Object o) |
void |
reset()
Reset for next iteration.
|
int |
size() |
equals, hashCode, removeAll
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, clear, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public NioSelectedKeySet()
public NioSelectedKeySet(int initialCapacity)
initialCapacity
- for the key setpublic int size()
size
in interface Collection<SelectionKey>
size
in interface Set<SelectionKey>
size
in class AbstractCollection<SelectionKey>
public int capacity()
public boolean add(SelectionKey selectionKey)
add
in interface Collection<SelectionKey>
add
in interface Set<SelectionKey>
add
in class AbstractCollection<SelectionKey>
public boolean remove(Object o)
remove
in interface Collection<SelectionKey>
remove
in interface Set<SelectionKey>
remove
in class AbstractCollection<SelectionKey>
public boolean contains(Object o)
contains
in interface Collection<SelectionKey>
contains
in interface Set<SelectionKey>
contains
in class AbstractCollection<SelectionKey>
public SelectionKey[] keys()
public void reset()
public int forEach(ToIntFunction<SelectionKey> function)
function
- to apply to each SelectionKey
public Iterator<SelectionKey> iterator()
iterator
in interface Iterable<SelectionKey>
iterator
in interface Collection<SelectionKey>
iterator
in interface Set<SelectionKey>
iterator
in class AbstractCollection<SelectionKey>
Copyright © 2014-2019 Real Logic Ltd. All Rights Reserved.