Module streamplify

The streamplify artifact

License

License

GroupId

GroupId

org.beryx
ArtifactId

ArtifactId

streamplify
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

Module streamplify
The streamplify artifact
Project URL

Project URL

https://github.com/beryx/streamplify
Source Code Management

Source Code Management

https://github.com/beryx/streamplify

Download streamplify

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.8.0-beta2

Project Modules

There are no modules declared in this project.

PRs Welcome License Build Status

Streamplify

The goal of this library is to provide useful Java 8 streams and to assist you in building new streams that allow efficient parallel processing.

The utilities offered by Streamplify include:

  • combinatorics streams: permutations, combinations, Cartesian products, power sets, derangements, partial permutations.
  • classes that help you implement your own efficient parallel streams.

Example

The following code snippet uses a parallel permutation stream to find all solutions of the N-Queens problem for n = 10.

System.out.println(new Permutations(10)
        .parallelStream()
        .filter(perm -> {
            for(int i = 0; i < perm.length - 1; i++) {
                for(int j = i + 1; j < perm.length; j++) {
                    if(Math.abs(perm[j] - perm[i]) == j - i) return false;
                }
            }
            return true;
        })
        .map(perm -> IntStream.range(0, perm.length)
                .mapToObj(i -> "(" + (i + 1) + "," + (perm[i] + 1) + ")")
                .collect(Collectors.joining(", ")))
        .collect(Collectors.joining("\n")));

Before starting to use the library, take a look at the examples, read the documentation and consult the javadoc.

Streamplify is available in Maven Central and JCenter.

Contribute to this project!

We accept all types of contributions and we are very welcoming to first time contributors.

Read how to contribute and jump in!

org.beryx

Beryx

Versions

Version
1.1.1
1.1.0
1.0.0