37
37
38
38
/**
39
39
* Builders for {@linkplain WindowedComputation windowed computations} used in the
40
- * {@link Aggregates#setWindowFields(Object, Bson, List ) $setWindowFields} pipeline stage
40
+ * {@link Aggregates#setWindowFields(Object, Bson, Iterable ) $setWindowFields} pipeline stage
41
41
* of an aggregation pipeline. Each windowed computation is a triple:
42
42
* <ul>
43
43
* <li>A window function. Some functions require documents in a window to be sorted
44
- * (see {@code sortBy} in {@link Aggregates#setWindowFields(Object, Bson, List )}).</li>
44
+ * (see {@code sortBy} in {@link Aggregates#setWindowFields(Object, Bson, Iterable )}).</li>
45
45
* <li>An optional {@linkplain Window window}, a.k.a. frame.
46
46
* Specifying {@code null} window is equivalent to specifying an unbounded window,
47
47
* i.e., a window with both ends specified as {@link Bound#UNBOUNDED}.
@@ -248,10 +248,10 @@ public static WindowedComputation count(final String path, @Nullable final Windo
248
248
/**
249
249
* Builds a computation of the time derivative by subtracting the evaluation result of the {@code expression} against the last document
250
250
* and the first document in the {@code window} and dividing it by the difference in the values of the
251
- * {@link Aggregates#setWindowFields(Object, Bson, List ) sortBy} field of the respective documents.
251
+ * {@link Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} field of the respective documents.
252
252
* Other documents in the {@code window} have no effect on the computation.
253
253
* <p>
254
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
254
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
255
255
*
256
256
* @param path The output field path.
257
257
* @param expression The expression.
@@ -273,10 +273,10 @@ public static <TExpression> WindowedComputation derivative(final String path, fi
273
273
/**
274
274
* Builds a computation of the time derivative by subtracting the evaluation result of the {@code expression} against the last document
275
275
* and the first document in the {@code window} and dividing it by the difference in the BSON {@link BsonType#DATE_TIME Date}
276
- * values of the {@link Aggregates#setWindowFields(Object, Bson, List ) sortBy} field of the respective documents.
276
+ * values of the {@link Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} field of the respective documents.
277
277
* Other documents in the {@code window} have no effect on the computation.
278
278
* <p>
279
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
279
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
280
280
*
281
281
* @param path The output field path.
282
282
* @param expression The expression.
@@ -303,13 +303,13 @@ public static <TExpression> WindowedComputation timeDerivative(final String path
303
303
304
304
/**
305
305
* Builds a computation of the approximate integral of a function that maps values of
306
- * the {@link Aggregates#setWindowFields(Object, Bson, List ) sortBy} field to evaluation results of the {@code expression}
306
+ * the {@link Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} field to evaluation results of the {@code expression}
307
307
* against the same document. The limits of integration match the {@code window} bounds.
308
308
* The approximation is done by using the
309
309
* <a href="https://www.khanacademy.org/math/ap-calculus-ab/ab-integration-new/ab-6-2/a/understanding-the-trapezoid-rule">
310
310
* trapezoidal rule</a>.
311
311
* <p>
312
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
312
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
313
313
*
314
314
* @param path The output field path.
315
315
* @param expression The expression.
@@ -329,11 +329,11 @@ public static <TExpression> WindowedComputation integral(final String path, fina
329
329
330
330
/**
331
331
* Builds a computation of the approximate integral of a function that maps BSON {@link BsonType#DATE_TIME Date} values of
332
- * the {@link Aggregates#setWindowFields(Object, Bson, List ) sortBy} field to evaluation results of the {@code expression}
332
+ * the {@link Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} field to evaluation results of the {@code expression}
333
333
* against the same document. The limits of integration match the {@code window} bounds.
334
334
* The approximation is done by using the trapezoidal rule.
335
335
* <p>
336
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
336
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
337
337
*
338
338
* @param path The output field path.
339
339
* @param expression The expression.
@@ -408,7 +408,7 @@ public static <TExpression> WindowedComputation covariancePop(final String path,
408
408
* that includes {@code n} - 1 documents preceding the current document and the current document, with more weight on documents
409
409
* closer to the current one.
410
410
* <p>
411
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
411
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
412
412
*
413
413
* @param path The output field path.
414
414
* @param expression The expression.
@@ -431,7 +431,7 @@ public static <TExpression> WindowedComputation expMovingAvg(final String path,
431
431
* Builds a computation of the exponential moving average of the evaluation results of the {@code expression} over the half-bounded
432
432
* window [{@link Bound#UNBOUNDED}, {@link Bound#CURRENT}], with {@code alpha} representing the degree of weighting decrease.
433
433
* <p>
434
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
434
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
435
435
*
436
436
* @param path The output field path.
437
437
* @param expression The expression.
@@ -455,7 +455,7 @@ public static <TExpression> WindowedComputation expMovingAvg(final String path,
455
455
/**
456
456
* Builds a computation that adds the evaluation results of the {@code expression} over the {@code window}
457
457
* to a BSON {@link org.bson.BsonType#ARRAY Array}.
458
- * Order within the array is guaranteed if {@link Aggregates#setWindowFields(Object, Bson, List ) sortBy} is specified.
458
+ * Order within the array is guaranteed if {@link Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} is specified.
459
459
*
460
460
* @param path The output field path.
461
461
* @param expression The expression.
@@ -492,7 +492,7 @@ public static <TExpression> WindowedComputation addToSet(final String path, fina
492
492
/**
493
493
* Builds a computation of the evaluation result of the {@code expression} against the first document in the {@code window}.
494
494
* <p>
495
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
495
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
496
496
*
497
497
* @param path The output field path.
498
498
* @param expression The expression.
@@ -512,7 +512,7 @@ public static <TExpression> WindowedComputation first(final String path, final T
512
512
* of evaluation results of the {@code inExpression} against the first {@code N} documents in the {@code window},
513
513
* where {@code N} is the positive integral value of the {@code nExpression}.
514
514
* <p>
515
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
515
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
516
516
*
517
517
* @param path The output field path.
518
518
* @param inExpression The input expression.
@@ -595,7 +595,7 @@ public static <OutExpression, NExpression> WindowedComputation topN(
595
595
/**
596
596
* Builds a computation of the evaluation result of the {@code expression} against the last document in the {@code window}.
597
597
* <p>
598
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
598
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
599
599
*
600
600
* @param path The output field path.
601
601
* @param expression The expression.
@@ -615,7 +615,7 @@ public static <TExpression> WindowedComputation last(final String path, final TE
615
615
* of evaluation results of the {@code inExpression} against the last {@code N} documents in the {@code window},
616
616
* where {@code N} is the positive integral value of the {@code nExpression}.
617
617
* <p>
618
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
618
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
619
619
*
620
620
* @param path The output field path.
621
621
* @param inExpression The input expression.
@@ -698,10 +698,10 @@ public static <OutExpression, NExpression> WindowedComputation bottomN(
698
698
/**
699
699
* Builds a computation of the evaluation result of the {@code expression} for the document whose position is shifted by the given
700
700
* amount relative to the current document. If the shifted document is outside of the
701
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) partition} containing the current document,
701
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) partition} containing the current document,
702
702
* then the {@code defaultExpression} is used instead of the {@code expression}.
703
703
* <p>
704
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
704
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
705
705
*
706
706
* @param path The output field path.
707
707
* @param expression The expression.
@@ -733,9 +733,9 @@ public static <TExpression> WindowedComputation shift(final String path, final T
733
733
734
734
/**
735
735
* Builds a computation of the order number of each document in its
736
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) partition}.
736
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) partition}.
737
737
* <p>
738
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
738
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
739
739
*
740
740
* @param path The output field path.
741
741
* @return The constructed windowed computation.
@@ -748,13 +748,13 @@ public static WindowedComputation documentNumber(final String path) {
748
748
749
749
/**
750
750
* Builds a computation of the rank of each document in its
751
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) partition}.
752
- * Documents with the same value(s) of the {@linkplain Aggregates#setWindowFields(Object, Bson, List ) sortBy} fields result in
751
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) partition}.
752
+ * Documents with the same value(s) of the {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} fields result in
753
753
* the same ranking and result in gaps in the returned ranks.
754
754
* For example, a partition with the sequence [1, 3, 3, 5] representing the values of the single {@code sortBy} field
755
755
* produces the following sequence of rank values: [1, 2, 2, 4].
756
756
* <p>
757
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
757
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
758
758
*
759
759
* @param path The output field path.
760
760
* @return The constructed windowed computation.
@@ -767,13 +767,13 @@ public static WindowedComputation rank(final String path) {
767
767
768
768
/**
769
769
* Builds a computation of the dense rank of each document in its
770
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) partition}.
771
- * Documents with the same value(s) of the {@linkplain Aggregates#setWindowFields(Object, Bson, List ) sortBy} fields result in
770
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) partition}.
771
+ * Documents with the same value(s) of the {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) sortBy} fields result in
772
772
* the same ranking but do not result in gaps in the returned ranks.
773
773
* For example, a partition with the sequence [1, 3, 3, 5] representing the values of the single {@code sortBy} field
774
774
* produces the following sequence of rank values: [1, 2, 2, 3].
775
775
* <p>
776
- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
776
+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
777
777
*
778
778
* @param path The output field path.
779
779
* @return The constructed windowed computation.
0 commit comments