Interface ComponentIterator.Next

    • Method Detail

      • next

        <N extends ComponentIterator.Next & BufferComponent> N next()
        Get the next component of the iteration, or null 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 the ComponentIterator.Next and BufferComponent 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, or null if there are no components with any readable bytes.

        The object returned will implement both of the ComponentIterator.Next and BufferComponent 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, or null if there are no components with any spare capacity.

        The object returned will implement both of the ComponentIterator.Next and BufferComponent interfaces.

        Returns:
        The next writable component of the iteration, or null if there are no writable components.