use of java.util.stream.DoubleStream in project GDSC-SMLM by aherbert.
the class TcPalmAnalysis method plotHistogram.
/**
* Plot a histogram of the extracted statistic.
*
* @param show set to true to show the histogram
* @param wo the window organiser
* @param clusters the clusters
* @param name the name
* @param function the function to extract the plotted statistic
* @param predicate the predicate to filter the stream of data
* @param action the action to use on the histogram plot (to set non-standard options)
*/
private static void plotHistogram(boolean show, WindowOrganiser wo, LocalList<ClusterData> clusters, String name, ToDoubleFunction<ClusterData> function, DoublePredicate predicate, Consumer<HistogramPlotBuilder> action) {
if (!show) {
return;
}
final StoredData data = new StoredData(clusters.size());
DoubleStream stream = clusters.stream().mapToDouble(function);
if (predicate != null) {
stream = stream.filter(predicate);
}
stream.forEach(data::add);
final HistogramPlotBuilder builder = new HistogramPlotBuilder(TITLE, data, name);
action.accept(builder);
builder.show(wo);
}
use of java.util.stream.DoubleStream in project keycloak by keycloak.
the class ClosingLongStream method asDoubleStream.
@Override
public DoubleStream asDoubleStream() {
DoubleStream result = delegate.asDoubleStream();
close();
return result;
}
use of java.util.stream.DoubleStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_DoubleStream_Test method isEqualTo_should_honor_comparing_the_same_mocked_stream.
@Test
void isEqualTo_should_honor_comparing_the_same_mocked_stream() {
DoubleStream stream = mock(DoubleStream.class);
assertThat(stream).isEqualTo(stream);
}
use of java.util.stream.DoubleStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_DoubleStream_Test method isSameAs_should_check_the_original_stream_without_consuming_it.
@Test
void isSameAs_should_check_the_original_stream_without_consuming_it() {
DoubleStream stream = mock(DoubleStream.class);
assertThat(stream).isSameAs(stream);
verifyNoInteractions(stream);
}
use of java.util.stream.DoubleStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_DoubleStream_Test method isInstanceOfAny_should_check_the_original_stream_without_consuming_it.
@Test
void isInstanceOfAny_should_check_the_original_stream_without_consuming_it() {
DoubleStream stream = mock(DoubleStream.class);
assertThat(stream).isInstanceOfAny(DoubleStream.class, String.class);
verifyNoInteractions(stream);
}
Aggregations