parallel-iterable

Guava alike concurrent FluentIterable

License

License

GroupId

GroupId

be.dabla
ArtifactId

ArtifactId

parallel-iterable
Last Version

Last Version

1.6
Release Date

Release Date

Type

Type

jar
Description

Description

parallel-iterable
Guava alike concurrent FluentIterable
Project URL

Project URL

https://github.com/dabla/parallel-iterable
Source Code Management

Source Code Management

https://github.com/dabla/parallel-iterable

Download parallel-iterable

How to add to project

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

Dependencies

provided (2)

Group / Artifact Type Version
com.google.guava : guava jar 14.0.1
org.slf4j : slf4j-api jar 1.7.10

test (5)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.10.19
org.assertj : assertj-core jar 1.7.1
junit : junit jar 4.8.2
org.openjdk.jmh : jmh-core jar 0.5.6
org.openjdk.jmh : jmh-generator-annprocess jar 0.5.6

Project Modules

There are no modules declared in this project.

Parallel-Iterable

Build Status

Transform or filter collections concurrently

Just use the ParallelIterable like you would use the FluentIterable in Guava. The transformation or filtering of each element will be done concurrently behind the scenes.

Code sample

package be.dabla.parallel.iterable;

import static com.google.common.collect.Lists.newArrayList;
import static java.math.BigInteger.ONE;
import static java.math.BigInteger.ZERO;

import java.math.BigInteger;
import java.util.List;

import com.google.common.base.Function;

public class Sample {
    
    public List<BigInteger> incrementAllByOne() {
        return ParallelIterable.from(newArrayList(ZERO, ONE))
                        	   .transform(addOne())
                        	   .toList();
    }
    
    private Function<BigInteger, BigInteger> addOne() {
        return new Function<BigInteger, BigInteger>() {
            public BigInteger apply(BigInteger input) {
                return input.add(ONE);
            }
        };
    }
}

How to use in your project

Example for Maven:

<dependency>
    <groupId>be.dabla</groupId>
    <artifactId>parallel-iterable</artifactId>
    <version>1.4</version>
</dependency>

Maven artifact can be found at https://oss.sonatype.org/content/repositories/public/be/dabla/parallel-iterable

Versions

Version
1.6
1.5
1.4
1.3
1.2
1.1
1.0