hg: lambda/lambda/jdk: - remove Spliterator.iterator(), see Streams.iteratorFrom for equivalent (original) (raw)

Paul Sandoz paul.sandoz at oracle.com
Tue Jan 22 04:16:10 PST 2013


Hi Remi,

On Jan 21, 2013, at 8:07 PM, Remi Forax <forax at univ-mlv.fr> wrote:

Paul (or Brian), can you explain how tryAdvance work ?

I updated the JavaDoc of tryAdvance (obtained via Doug):

/**
 * If a remaining element exists, performs the given action on it,
 * returning {@code true}, else returns {@code false}.
 *
 * @param block The action.
 * @return {@code false} if no remaining elements existed
 * upon entry to this method, else {@code true}.
 */

Can be used like this:

Block b = ... while(s.tryAdvance(b));

(e.g. that could be the default forEach method.)

I expect there will be a more thorough update to Spliterator docs soon once Doug's updates are ready.

Hth, Paul.



More information about the lambda-libs-spec-observers mailing list