Defines an api for more advanced sequential Streams. Extends java.util.stream.Stream and jool.Seq to add even more functionality. Reactive Streams support available if simple-react added to the classpath.
where x.y.z represents the latest version
compile 'com.aol.cyclops:cyclops-streams:x.y.z'
<dependency>
<groupId>com.aol.cyclops</groupId>
<artifactId>cyclops-streams</artifactId>
<version>x.y.z</version>
</dependency>
- Fast sequential Streams that can run asyncrhonously
- Reactive Stream Support
- Efficient Stream reversal
- static Stream Utilities
- SequenceM implementation
- Terminal operations that return a Future to be populated asynchronously
- HotStream support
cyclops-invokedynamic cyclops-monad-api cyclops-sequence-api
simple-react
where x.y.z represents the latest version
compile 'com.aol.cyclops:cyclops-streams:x.y.z'
Large number of Stream operators available on SequenceM or as static methods for java.util.Stream (SequenceM extends java.util.Stream)
- Reactive Streams support
- Connectable Hot Streams
- Core Operators
- Async Operators
- Async Operators ints
- Async Operators doubles
- Async Operators longss
- Available as static methods
Monoid<String> concat = Monoid.of("",(a,b)->a+b);
Monoid<String> join = Monoid.of("",(a,b)->a+","+b);
StreamUtils.reduce(Stream.of("hello", "world", "woo!"),Stream.of(concat,join));
Results in ["helloworldwoo!",",hello,world,woo!"]
See also Monoid.reduce(Stream s)
StreamUtils.cycle(Stream.of(1,2,3)).limit(6).collect(Collectors.toList())
Results in [1,2,3,1,2,3]
StreamUtils.reverse(Stream.of(1,2,3)).collect(Collectors.toList())
Results in [3,2,1]
From Iterable
StreamUtils.stream(Arrays.asList(1,2,3)).collect(Collectors.toList())
From Iterator
StreamUtils.stream(Arrays.asList(1,2,3).iterator()).collect(Collectors.toList())
ReversedIterator.reversedStream(LazySeq.iterate(class1, c->c.getSuperclass())
.takeWhile(c->c!=Object.class).toList());