@Test public void toTimespanIntervalMax() { final ISeq<Integer> values = IntStream.range(1, 101).boxed() .flatMap(Streams.toIntervalMax(Duration.ofMillis(10), new TestClock())) .collect(ISeq.toISeq()); Assert.assertEquals(values.length(),10); int start = 0; for (int i = 0; i < values.size(); ++i) { final int diff = values.get(i) - start; Assert.assertEquals(diff, 10); start = values.get(i); } }
public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); static Function<C, Stream<C>> toStrictlyIncreasing(); static Function<C, Stream<C>> toStrictlyDecreasing(); static Function<T, Stream<T>> toStrictlyImproving(final Comparator<? super T> comparator); static Function<C, Stream<C>> toIntervalMax(final int size); static Function<C, Stream<C>> toIntervalMin(final int size); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final int size); static Function<C, Stream<C>> toIntervalMax(final Duration timespan); static Function<C, Stream<C>> toIntervalMax(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalMin(final Duration timespan); static Function<C, Stream<C>> toIntervalMin(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final Duration timespan); static Function<C, Stream<C>> toIntervalBest(
		final Comparator<? super C> comparator,
		final Duration timespan,
		final Clock clock
	); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); static Function<C, Stream<C>> toStrictlyIncreasing(); static Function<C, Stream<C>> toStrictlyDecreasing(); static Function<T, Stream<T>> toStrictlyImproving(final Comparator<? super T> comparator); static Function<C, Stream<C>> toIntervalMax(final int size); static Function<C, Stream<C>> toIntervalMin(final int size); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final int size); static Function<C, Stream<C>> toIntervalMax(final Duration timespan); static Function<C, Stream<C>> toIntervalMax(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalMin(final Duration timespan); static Function<C, Stream<C>> toIntervalMin(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final Duration timespan); static Function<C, Stream<C>> toIntervalBest(
		final Comparator<? super C> comparator,
		final Duration timespan,
		final Clock clock
	);  }