threeten-spliterators

Spliterators for JSR-310 data types.

License

License

MIT
GroupId

GroupId

com.github.marschall
ArtifactId

ArtifactId

threeten-spliterators
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

threeten-spliterators
Spliterators for JSR-310 data types.
Project URL

Project URL

https://github.com/marschall/threeten-spliterators
Source Code Management

Source Code Management

https://github.com/marschall/threeten-spliterators

Download threeten-spliterators

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.marschall/threeten-spliterators/ -->
<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>threeten-spliterators</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.marschall/threeten-spliterators/
implementation 'com.github.marschall:threeten-spliterators:0.2.0'
// https://jarcasting.com/artifacts/com.github.marschall/threeten-spliterators/
implementation ("com.github.marschall:threeten-spliterators:0.2.0")
'com.github.marschall:threeten-spliterators:jar:0.2.0'
<dependency org="com.github.marschall" name="threeten-spliterators" rev="0.2.0">
  <artifact name="threeten-spliterators" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.marschall', module='threeten-spliterators', version='0.2.0')
)
libraryDependencies += "com.github.marschall" % "threeten-spliterators" % "0.2.0"
[com.github.marschall/threeten-spliterators "0.2.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

JSR-310 Spliterators Build Status Maven Central

Spliterators for JSR-310 (Java Date Time API) data types allowing you to create streams over JSR-310 data types.

For example you can iterate over all days in a year

LocalDateStreams.range(LocalDate.of(2016, 1, 1), LocalDate.of(2016, 2, 1))
  .forEach((localDate) -> {
    // body
});

or over all months in a year

YearMonthStreams.rangeClosed(YearMonth.of(2016, 1), YearMonth.of(2016, 12))
  .forEach((yearMonth) -> {
    // body
});

Besides the predefined iterations by day for LocalDate and month for YearMonth we offer a generic way to iterate over any Temporal with any increment given by a TemporalAdjuster.

For example you can iterate over all Mondays.

LocalDate start = LocalDate.of(2016, 1, 1).with(nextOrSame(MONDAY));
LocalDate end = LocalDate.of(2016, 1, 1).with(lastDayOfMonth());
TemporalStreams.rangeClosed(start, end, next(MONDAY))
  .forEach((localDate) -> {
    // body
});

All the stream methods like #map or #filter are available.

For more information check out the Javadoc.

Versions

Version
0.2.0
0.1.0