On 29/04/2013 09:53, Paul Sandoz wrote:
Yes, since a stream of increasing int values, corresponding to indexes of set bits, is created (the current index of a set bit is used to obtain the index of the next set bit) i.e. it is doing: for (int i = bs.nextSetBit(0); i>= 0; i = bs.nextSetBit(i+1)) { } (Note that primitive streams created from ranges are also sorted/distinct, although we are still working out the edge cases for doubles).
Got it, I mis-read it and now see that the indexes are returned in order. -Alan.