@Test public void stream() { final List<TimeSeriesCollection> result = WindowedTSCIterator.stream(collections.stream(), lookBack, lookForward) .collect(Collectors.toList()); assertEquals(expected, result); }
public static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( new WindowedTSCIterator(in, lookBack, lookForward), NONNULL | IMMUTABLE | ORDERED | SORTED | DISTINCT), false); }
WindowedTSCIterator implements Iterator<TimeSeriesCollection> { public static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( new WindowedTSCIterator(in, lookBack, lookForward), NONNULL | IMMUTABLE | ORDERED | SORTED | DISTINCT), false); } }
WindowedTSCIterator implements Iterator<TimeSeriesCollection> { public static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( new WindowedTSCIterator(in, lookBack, lookForward), NONNULL | IMMUTABLE | ORDERED | SORTED | DISTINCT), false); } WindowedTSCIterator(@NonNull Iterator<TimeSeriesCollection> underlying, @NonNull Duration lookBack, @NonNull Duration lookForward); }
WindowedTSCIterator implements Iterator<TimeSeriesCollection> { public static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( new WindowedTSCIterator(in, lookBack, lookForward), NONNULL | IMMUTABLE | ORDERED | SORTED | DISTINCT), false); } WindowedTSCIterator(@NonNull Iterator<TimeSeriesCollection> underlying, @NonNull Duration lookBack, @NonNull Duration lookForward); static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward); static Stream<TimeSeriesCollection> stream(Stream<TimeSeriesCollection> in, Duration lookBack, Duration lookForward); @Override boolean hasNext(); @Override TimeSeriesCollection next(); }
WindowedTSCIterator implements Iterator<TimeSeriesCollection> { public static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( new WindowedTSCIterator(in, lookBack, lookForward), NONNULL | IMMUTABLE | ORDERED | SORTED | DISTINCT), false); } WindowedTSCIterator(@NonNull Iterator<TimeSeriesCollection> underlying, @NonNull Duration lookBack, @NonNull Duration lookForward); static Stream<TimeSeriesCollection> stream(Iterator<TimeSeriesCollection> in, Duration lookBack, Duration lookForward); static Stream<TimeSeriesCollection> stream(Stream<TimeSeriesCollection> in, Duration lookBack, Duration lookForward); @Override boolean hasNext(); @Override TimeSeriesCollection next();  }