MCPcopy Index your code
hub / github.com/beryx/streamplify

github.com/beryx/streamplify @v1.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.1 ↗ · + Follow
354 symbols 711 edges 53 files 119 documented · 34%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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!

Extension points exported contracts — how you extend this code

IntArraySupplier (Interface)
This interface acts as a trait that helps implementing the valueSupplier requested by indexed-spliterators (such as {@li [6 …
streamplify/src/main/java/org/beryx/streamplify/IntArraySupplier.java
Splittable (Interface)
A functional interface providing a method for splitting this instance. Used primarily by implementations of the valu [14 …
streamplify/src/main/java/org/beryx/streamplify/Splittable.java
LongIndexed (Interface)
(no doc) [14 implementers]
streamplify/src/main/java/org/beryx/streamplify/Splittable.java
BigIntegerIndexed (Interface)
(no doc) [14 implementers]
streamplify/src/main/java/org/beryx/streamplify/Splittable.java
BigIntegerShuffler (Interface)
Provides a way of shuffling BigInteger indices. The shuffling function should be a permutation of the set of indices. [4 …
streamplify/src/main/java/org/beryx/streamplify/shuffler/BigIntegerShuffler.java

Core symbols most depended-on inside this repo

stream
called by 38
streamplify/src/main/java/org/beryx/streamplify/Streamable.java
withAdditionalCharacteristics
called by 18
streamplify/src/main/java/org/beryx/streamplify/Streamable.java
withValueSupplier
called by 16
streamplify/src/main/java/org/beryx/streamplify/LongIndexedSpliterator.java
getNextSequence
called by 12
streamplify/src/main/java/org/beryx/streamplify/IntArraySupplier.java
toString
called by 10
streamplify-examples/src/main/java/org/beryx/streamplify/example/Diet.java
parallelStream
called by 10
streamplify/src/main/java/org/beryx/streamplify/Streamable.java
getDelegate
called by 8
streamplify/src/main/java/org/beryx/streamplify/StreamableProxy.java
getShuffledIndex
called by 7
streamplify/src/main/java/org/beryx/streamplify/shuffler/LongShuffler.java

Shape

Method 279
Class 68
Interface 7

Languages

Java100%

Modules by API surface

streamplify/src/main/java/org/beryx/streamplify/partperm/PartialPermutationSupplier.java27 symbols
streamplify/src/main/java/org/beryx/streamplify/LongIndexedSpliterator.java18 symbols
streamplify/src/main/java/org/beryx/streamplify/BigIntegerIndexedSpliterator.java18 symbols
streamplify/src/main/java/org/beryx/streamplify/derangement/DerangementSupplier.java17 symbols
streamplify/src/main/java/org/beryx/streamplify/powerset/PowerSetSupplier.java16 symbols
streamplify/src/main/java/org/beryx/streamplify/permutation/PermutationSupplier.java16 symbols
streamplify-examples/src/main/java/org/beryx/streamplify/benchmark/ShufflerView.java15 symbols
streamplify/src/main/java/org/beryx/streamplify/product/CartesianProductSupplier.java14 symbols
streamplify/src/main/java/org/beryx/streamplify/combination/CombinationSupplier.java14 symbols
streamplify-examples/src/main/java/org/beryx/streamplify/benchmark/DelayedBenchmark.java14 symbols
streamplify/src/main/java/org/beryx/streamplify/StreamableProxy.java9 symbols
streamplify/src/main/java/org/beryx/streamplify/Streamable.java9 symbols

For agents

$ claude mcp add streamplify \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact