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
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,8 @@ To use this library in your project, add this to your dependencies:
13
13
14
14
These are fully functional streams, so you can use them like any other stream, once created.
15
15
16
-
Once `Stream.takeWhile()` support is added in Java 9, this library will not be very useful. The lack
17
-
of a convenient `takeWhile(Predicate<T> predicate)` method in Java 8 is what lead to the creation
18
-
of this library.
19
-
16
+
The lack of a convenient `takeWhile(Predicate<T> predicate)` method in Java 8 is what led to the creation
17
+
of this library. Now that Java 9 has `Stream.takeWhile()` support, there is no reason to add this as a dependency.
20
18
21
19
This library can create streams of the following java.time classes:
22
20
@@ -51,6 +49,13 @@ To make the optional end of the stream exclusive, you can call one of two method
51
49
+`.until(T to)` - Type-specific end point. Can be null to indicate forever
52
50
+`.until(amount, units)` - Where `amount` is a positive integer (for forward through time) or a negative integer (for backward through time), and `unit` is a valid `ChronoUnit`
53
51
52
+
To indicate how much time should be skipped in each iteration:
53
+
54
+
+`.every(amount, units)` - Where `amount` is an integer representing the number of units, and `unit` is a valid `ChronoUnit`
55
+
+`.every(period)` - Where `period` is a valid `Period` object. (Supported on `LocalDateStream` and `YearMonthStream` only).
56
+
+`.every(duration)` - Where `duration` is a valid `Duration` object. (Supported on everything other than `LocalDateStream` and `YearMonthStream`).
57
+
58
+
54
59
Note that providing an end time (via `to` or `until`) is optional. In that case, the stream will
55
60
have no end and should produce values until you stop it.
0 commit comments