use of java.util.IntSummaryStatistics in project java8-tutorial by winterbe.
the class Streams10 method test4.
private static void test4(List<Person> persons) {
IntSummaryStatistics ageSummary = persons.stream().collect(Collectors.summarizingInt(p -> p.age));
System.out.println(ageSummary);
// IntSummaryStatistics{count=4, sum=76, min=12, average=19,000000, max=23}
}
use of java.util.IntSummaryStatistics in project intellij-community by JetBrains.
the class Main method generate.
public static IntSummaryStatistics generate() {
IntSummaryStatistics stat = new IntSummaryStatistics();
long limit = 33;
OUTER: while (true) {
Integer x = 10;
for (int i = 0; i < x; i++) {
if (limit-- == 0)
break OUTER;
stat.accept(i);
}
}
return stat;
}
use of java.util.IntSummaryStatistics in project intellij-community by JetBrains.
the class Main method generateMethodRef.
public static IntSummaryStatistics generateMethodRef() {
IntSummaryStatistics stat = new IntSummaryStatistics();
long limit = 33;
OUTER: while (true) {
Integer x = getInt();
for (int i = 0; i < x; i++) {
if (limit-- == 0)
break OUTER;
stat.accept(i);
}
}
return stat;
}
use of java.util.IntSummaryStatistics in project intellij-community by JetBrains.
the class Main method testOfSupplier.
private static IntSummaryStatistics testOfSupplier() {
IntSummaryStatistics stat = new IntSummaryStatistics();
for (Supplier<Integer> sup : Arrays.<Supplier<Integer>>asList(() -> 1, /*between*/
() -> 2, () -> 3)) {
int i = sup.get();
stat.accept(i);
}
return stat;
}
use of java.util.IntSummaryStatistics in project intellij-community by JetBrains.
the class Main method testNestedRename.
public static IntSummaryStatistics testNestedRename() {
IntSummaryStatistics stat = new IntSummaryStatistics();
for (int x = 0; x < 20; x++) {
if (x > 2) {
long limit = x;
for (String s = String.valueOf(x); ; s = s + x) {
if (limit-- == 0)
break;
int length = s.length();
stat.accept(length);
}
}
}
return stat;
}
Aggregations