3737
3838/**
3939 * 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
4141 * of an aggregation pipeline. Each windowed computation is a triple:
4242 * <ul>
4343 * <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>
4545 * <li>An optional {@linkplain Window window}, a.k.a. frame.
4646 * Specifying {@code null} window is equivalent to specifying an unbounded window,
4747 * 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
248248 /**
249249 * Builds a computation of the time derivative by subtracting the evaluation result of the {@code expression} against the last document
250250 * 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.
252252 * Other documents in the {@code window} have no effect on the computation.
253253 * <p>
254- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
254+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
255255 *
256256 * @param path The output field path.
257257 * @param expression The expression.
@@ -273,10 +273,10 @@ public static <TExpression> WindowedComputation derivative(final String path, fi
273273 /**
274274 * Builds a computation of the time derivative by subtracting the evaluation result of the {@code expression} against the last document
275275 * 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.
277277 * Other documents in the {@code window} have no effect on the computation.
278278 * <p>
279- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
279+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
280280 *
281281 * @param path The output field path.
282282 * @param expression The expression.
@@ -303,13 +303,13 @@ public static <TExpression> WindowedComputation timeDerivative(final String path
303303
304304 /**
305305 * 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}
307307 * against the same document. The limits of integration match the {@code window} bounds.
308308 * The approximation is done by using the
309309 * <a href="https://www.khanacademy.org/math/ap-calculus-ab/ab-integration-new/ab-6-2/a/understanding-the-trapezoid-rule">
310310 * trapezoidal rule</a>.
311311 * <p>
312- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
312+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
313313 *
314314 * @param path The output field path.
315315 * @param expression The expression.
@@ -329,11 +329,11 @@ public static <TExpression> WindowedComputation integral(final String path, fina
329329
330330 /**
331331 * 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}
333333 * against the same document. The limits of integration match the {@code window} bounds.
334334 * The approximation is done by using the trapezoidal rule.
335335 * <p>
336- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
336+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
337337 *
338338 * @param path The output field path.
339339 * @param expression The expression.
@@ -408,7 +408,7 @@ public static <TExpression> WindowedComputation covariancePop(final String path,
408408 * that includes {@code n} - 1 documents preceding the current document and the current document, with more weight on documents
409409 * closer to the current one.
410410 * <p>
411- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
411+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
412412 *
413413 * @param path The output field path.
414414 * @param expression The expression.
@@ -431,7 +431,7 @@ public static <TExpression> WindowedComputation expMovingAvg(final String path,
431431 * Builds a computation of the exponential moving average of the evaluation results of the {@code expression} over the half-bounded
432432 * window [{@link Bound#UNBOUNDED}, {@link Bound#CURRENT}], with {@code alpha} representing the degree of weighting decrease.
433433 * <p>
434- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
434+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
435435 *
436436 * @param path The output field path.
437437 * @param expression The expression.
@@ -455,7 +455,7 @@ public static <TExpression> WindowedComputation expMovingAvg(final String path,
455455 /**
456456 * Builds a computation that adds the evaluation results of the {@code expression} over the {@code window}
457457 * 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.
459459 *
460460 * @param path The output field path.
461461 * @param expression The expression.
@@ -492,7 +492,7 @@ public static <TExpression> WindowedComputation addToSet(final String path, fina
492492 /**
493493 * Builds a computation of the evaluation result of the {@code expression} against the first document in the {@code window}.
494494 * <p>
495- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
495+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
496496 *
497497 * @param path The output field path.
498498 * @param expression The expression.
@@ -512,7 +512,7 @@ public static <TExpression> WindowedComputation first(final String path, final T
512512 * of evaluation results of the {@code inExpression} against the first {@code N} documents in the {@code window},
513513 * where {@code N} is the positive integral value of the {@code nExpression}.
514514 * <p>
515- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
515+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
516516 *
517517 * @param path The output field path.
518518 * @param inExpression The input expression.
@@ -595,7 +595,7 @@ public static <OutExpression, NExpression> WindowedComputation topN(
595595 /**
596596 * Builds a computation of the evaluation result of the {@code expression} against the last document in the {@code window}.
597597 * <p>
598- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
598+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
599599 *
600600 * @param path The output field path.
601601 * @param expression The expression.
@@ -615,7 +615,7 @@ public static <TExpression> WindowedComputation last(final String path, final TE
615615 * of evaluation results of the {@code inExpression} against the last {@code N} documents in the {@code window},
616616 * where {@code N} is the positive integral value of the {@code nExpression}.
617617 * <p>
618- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
618+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
619619 *
620620 * @param path The output field path.
621621 * @param inExpression The input expression.
@@ -698,10 +698,10 @@ public static <OutExpression, NExpression> WindowedComputation bottomN(
698698 /**
699699 * Builds a computation of the evaluation result of the {@code expression} for the document whose position is shifted by the given
700700 * 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,
702702 * then the {@code defaultExpression} is used instead of the {@code expression}.
703703 * <p>
704- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
704+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
705705 *
706706 * @param path The output field path.
707707 * @param expression The expression.
@@ -733,9 +733,9 @@ public static <TExpression> WindowedComputation shift(final String path, final T
733733
734734 /**
735735 * 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}.
737737 * <p>
738- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
738+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
739739 *
740740 * @param path The output field path.
741741 * @return The constructed windowed computation.
@@ -748,13 +748,13 @@ public static WindowedComputation documentNumber(final String path) {
748748
749749 /**
750750 * 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
753753 * the same ranking and result in gaps in the returned ranks.
754754 * For example, a partition with the sequence [1, 3, 3, 5] representing the values of the single {@code sortBy} field
755755 * produces the following sequence of rank values: [1, 2, 2, 4].
756756 * <p>
757- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
757+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
758758 *
759759 * @param path The output field path.
760760 * @return The constructed windowed computation.
@@ -767,13 +767,13 @@ public static WindowedComputation rank(final String path) {
767767
768768 /**
769769 * 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
772772 * the same ranking but do not result in gaps in the returned ranks.
773773 * For example, a partition with the sequence [1, 3, 3, 5] representing the values of the single {@code sortBy} field
774774 * produces the following sequence of rank values: [1, 2, 2, 3].
775775 * <p>
776- * {@linkplain Aggregates#setWindowFields(Object, Bson, List ) Sorting} is required.</p>
776+ * {@linkplain Aggregates#setWindowFields(Object, Bson, Iterable ) Sorting} is required.</p>
777777 *
778778 * @param path The output field path.
779779 * @return The constructed windowed computation.
0 commit comments