private static class NioSocketAcceptor.ServerSocketChannelIterator
extends java.lang.Object
implements java.util.Iterator<java.nio.channels.ServerSocketChannel>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Iterator<java.nio.channels.SelectionKey> |
iterator
The selected-key iterator
|
| Modifier | Constructor and Description |
|---|---|
private |
ServerSocketChannelIterator(java.util.Collection<java.nio.channels.SelectionKey> selectedKeys)
Build a SocketChannel iterator which will return a SocketChannel instead of
a SelectionKey.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Tells if there are more SockectChannel left in the iterator
|
java.nio.channels.ServerSocketChannel |
next()
Get the next SocketChannel in the operator we have built from
the selected-key et for this selector.
|
void |
remove()
Remove the current SocketChannel from the iterator
|
private final java.util.Iterator<java.nio.channels.SelectionKey> iterator
private ServerSocketChannelIterator(java.util.Collection<java.nio.channels.SelectionKey> selectedKeys)
selectedKeys - The selector selected-key setpublic boolean hasNext()
hasNext in interface java.util.Iterator<java.nio.channels.ServerSocketChannel>true if there is at least one more
SockectChannel object to readpublic java.nio.channels.ServerSocketChannel next()
next in interface java.util.Iterator<java.nio.channels.ServerSocketChannel>public void remove()
remove in interface java.util.Iterator<java.nio.channels.ServerSocketChannel>