Java Code Examples for java.util.stream.DoubleStream#iterator()

The following examples show how to use java.util.stream.DoubleStream#iterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamUtility.java    From tutorials with MIT License 3 votes vote down vote up
public static boolean assertStreamEquals(DoubleStream stream1, DoubleStream stream2) {

        Iterator iterator1 = stream1.iterator();
        Iterator iterator2 = stream2.iterator();

        while (iterator1.hasNext()) {
            Assert.assertEquals(iterator1.next(), iterator2.next());
        }

        Assert.assertFalse(iterator2.hasNext());

        return true;
    }
 
Example 2
Source File: StreamDoubleIterator.java    From RankSys with Mozilla Public License 2.0 2 votes vote down vote up
/**
 * Constructor.
 *
 * @param stream wrapped stream
 */
public StreamDoubleIterator(DoubleStream stream) {
    this.it = stream.iterator();
}