-
- Enclosing interface:
- ComponentIterator<T extends ComponentIterator.Next & BufferComponent>
public static interface ComponentIterator.NextThis interface exposes external iteration on components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <N extends ComponentIterator.Next & BufferComponent>
Nnext()Get the next component of the iteration, ornullif there are no more components.default <N extends ComponentIterator.Next & BufferComponent>
NnextReadable()Get the next component of the iteration that has any bytes to read, ornullif there are no components with any readable bytes.default <N extends ComponentIterator.Next & BufferComponent>
NnextWritable()Get the next component of the iteration that has any space for writing bytes, ornullif there are no components with any spare capacity.
-
-
-
Method Detail
-
next
<N extends ComponentIterator.Next & BufferComponent> N next()
Get the next component of the iteration, ornullif there are no more components.The returned object, if any, will be of the same type as this object, and would typically be assigned to the same variable.
Iteration is only valid while the
ComponentIteratoris open. Calling this method after the associated component iterator has been closed may result in undefined behaviour.- Type Parameters:
N- A type that implements theComponentIterator.NextandBufferComponentinterfaces.- Returns:
- The next component in the iteration, or
nullif there are no more components.
-
nextReadable
default <N extends ComponentIterator.Next & BufferComponent> N nextReadable()
Get the next component of the iteration that has any bytes to read, ornullif there are no components with any readable bytes.The object returned will implement both of the
ComponentIterator.NextandBufferComponentinterfaces.- Returns:
- The next readable component of the iteration, or
nullif there are no readable components.
-
nextWritable
default <N extends ComponentIterator.Next & BufferComponent> N nextWritable()
Get the next component of the iteration that has any space for writing bytes, ornullif there are no components with any spare capacity.The object returned will implement both of the
ComponentIterator.NextandBufferComponentinterfaces.- Returns:
- The next writable component of the iteration, or
nullif there are no writable components.
-
-