Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Iterable Extensions for Java 6+

License

NotificationsYou must be signed in to change notification settings

akarnokd/ixjava

Repository files navigation

codecov.ioMaven Central

Iterable Extensions for Java, the dual of RxJava. Originally implemented in the Reactive4Java framework, now standalone; no dependencies on any reactive library.

The aim is to provide, lazily evaluated, pull-based datastream support with the same naming as in RxJava mainly for the pre-Java-8 world. The Stream API in Java 8 is not exactly the same thing because Streams can be only consumed once whileIterables can be consumed many times. Google Guava features a lot of Iterable operators, plus now they have theFluentIterable with similar setupbut far less operators available.

This branch starts from scratch by reimplementingix.Ix and all of its operators based on the +5 year experience with reactiveand interactive dataflows.

Releases

Javadoc:https://akarnokd.github.io/ixjava/javadoc/index.html

gradle

dependencies {    implementation'com.github.akarnokd:ixjava:1.0.0'}

Maven search:

http://search.maven.org

Examples

The main (and only) entry point is the classix.Ix which features a bunch of static factory methods:

List<Integer>list =Arrays.asList(1,2,3,4,5);Ix<Integer>seq =Ix.from(list);

Now we can apply instance methods on theseq sequence, just like in RxJava. Not all operators are available though due to the synchronous-pull nature of IxJava.

seq.map(v ->v +1).filter(v ->v %2 ==0).flatMap(v ->Ix.fromArray(v *10,v *100))).subscribe(System.out::println);

SinceIx implementsIterable, you can use the for-each loop to consume it:

for (Integerv :Ix.fromArray(5,10).skip(1).concatWith(Ix.just(20))) {System.out.println("Value: " +v);}

For further details on the possibilities, please study the javadoc ofIx.

About

Iterable Extensions for Java 6+

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp