-
- Enclosing interface:
- ComponentIterator<T extends ComponentIterator.Next & BufferComponent>
public static interface ComponentIterator.Next
This 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, ornull
if 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, ornull
if 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, ornull
if 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, ornull
if 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
ComponentIterator
is 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.Next
andBufferComponent
interfaces.- Returns:
- The next component in the iteration, or
null
if 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, ornull
if there are no components with any readable bytes.The object returned will implement both of the
ComponentIterator.Next
andBufferComponent
interfaces.- Returns:
- The next readable component of the iteration, or
null
if 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, ornull
if there are no components with any spare capacity.The object returned will implement both of the
ComponentIterator.Next
andBufferComponent
interfaces.- Returns:
- The next writable component of the iteration, or
null
if there are no writable components.
-
-