You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[jOOQ#360] Add Agg.stddev() and variance() and similar aggregate functions
- Renamed methods to stddevDouble() and varianceDouble() (no usage of By())
- Simplified collectors by reusing JDK Collectors.collectingAndThen()
- Removed comments and Javadoc
* The class name isn't set in stone and will change.
40
39
*
41
40
* @author Lukas Eder
41
+
* @author Jichen Lu
42
42
*/
43
43
publicclassAgg {
44
44
@@ -1013,14 +1013,14 @@ private static int percentileIndex(double percentile, int size) {
1013
1013
}
1014
1014
1015
1015
/**
1016
-
* Get a {@link Collector} that calculates the derived <code>PERCENTILE_DISC(percentile)</code> function given a specific ordering, producing multiple results.
1016
+
* Get a {@link Collector} that calculates the <code>PERCENTILE_DISC(percentile)</code> function given a specific ordering, producing multiple results.
* Get a {@link Collector} that calculates the derived <code>PERCENTILE_DISC(percentile)</code> function given a specific ordering, producing multiple results.
1023
+
* Get a {@link Collector} that calculates the <code>PERCENTILE_DISC(percentile)</code> function given a specific ordering, producing multiple results.
Copy file name to clipboardExpand all lines: jOOL-java-8/src/test/java/org/jooq/lambda/CollectorTests.java
+22-69Lines changed: 22 additions & 69 deletions
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,12 @@
22
22
importstaticorg.jooq.lambda.tuple.Tuple.tuple;
23
23
importstaticorg.junit.Assert.assertEquals;
24
24
25
-
importjava.text.DecimalFormat;
26
25
importjava.util.Optional;
27
26
importjava.util.function.Function;
28
27
importjava.util.Comparator;
29
-
importjava.util.Optional;
30
28
importjava.util.function.Supplier;
31
29
importjava.util.stream.Collector;
32
30
importjava.util.stream.Stream;
33
-
importjava.util.function.Function;
34
31
35
32
importorg.jooq.lambda.tuple.Tuple;
36
33
importorg.jooq.lambda.tuple.Tuple9;
@@ -571,7 +568,7 @@ public void testMedianAllByWithoutComparator() {
571
568
572
569
@Test
573
570
publicvoidtestMedianAllByWithoutComparator2() {
574
-
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
571
+
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
575
572
e = newItem(2), f = newItem(3), g = newItem(3), h = newItem(3),
576
573
i = newItem(4), j = newItem(4), k = newItem(5), l = newItem(6),
577
574
m = newItem(7), n = newItem(7), o = newItem(7), p = newItem(7);
@@ -586,12 +583,12 @@ public void testMedianAllWithComparator() {
586
583
587
584
@Test
588
585
publicvoidtestMedianAllWithComparator2() {
589
-
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
586
+
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
590
587
e = newItem(2), f = newItem(3), g = newItem(3), h = newItem(3),
591
588
i = newItem(4), j = newItem(4), k = newItem(5), l = newItem(6),
592
589
m = newItem(7), n = newItem(7), o = newItem(7), p = newItem(7);
593
590
594
-
assertEquals(asList(j, i), Seq.of(c, j, n, d, e, o, l, p, a, m, h, b, k, g, f, i).collect(medianAll(Comparator.comparing(Item::reverse))).toList());
591
+
assertEquals(asList(j, i), Seq.of(c, j, n, d, e, o, l, p, a, m, h, b, k, g, f, i).collect(medianAll(Comparator.comparing(CollectorTests.Item::reverse))).toList());
595
592
}
596
593
597
594
@Test
@@ -605,7 +602,7 @@ public void testMedianAllWithoutComparator() {
605
602
606
603
@Test
607
604
publicvoidtestMedianAllWithoutComparator2() {
608
-
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
605
+
Itema = newItem(1), b = newItem(1), c = newItem(2), d = newItem(2),
609
606
e = newItem(2), f = newItem(3), g = newItem(3), h = newItem(3),
610
607
i = newItem(4), j = newItem(4), k = newItem(5), l = newItem(6),
611
608
m = newItem(7), n = newItem(7), o = newItem(7), p = newItem(7);
@@ -1313,73 +1310,29 @@ public void testDropping() {
0 commit comments