streamsupport


Source link: https://github.com/streamsupport/streamsupport

Import from http://hg.code.sf.net/p/streamsupport/code

streamsupport is a backport of the Java 8 java.util.function (functional interfaces) and java.util.stream (streams) API for users of Java 6 or 7 supplemented with selected additions from java.util.concurrent which didn't exist back in Java 6.

Due to the lack of default interface methods and static interface methods in pre-Java 8 the API had to be slightly adjusted in these areas but still covers the full functionality scope of Java 8. In detail, static and default interface methods have been moved to companion classes in the same package that bear the identical name as the interface but with an "s" appended (e.g. Comparator -> Comparators).

For ease of use, the default methods for most of the functional interfaces were NOT retained as abstract methods in the redefined interfaces (keeping them single method interfaces) - the missing default (and static) methods can always be found in the corresponding companion class.

Want also lambdas? https://github.com/orfjackal/retrolambda

streamsupport Web Site

Categories

Libraries

Features

  • Java 8 Streams library backport
  • Java 8 CompletableFuture backport
  • Java 8 Parallel array operations backport
  • Java 8 Functional interfaces backport
  • Further java.util.concurrent enhancements from Java 7/8 backported to Java 6
  • Includes miscellaneous Java 8 goodies (Optional, StringJoiner, ...)
  • Supports Android

Usage

After:

RefStreams.of("one", "two", "three", "four")
  .filter(e -> e.length() > 3)
  .peek(e -> System.out.println("Filtered value: " + e))
  .map(String::toUpperCase)
  .peek(e -> System.out.println("Mapped value: " + e))
  .collect(Collectors.toList());

After:

public static List<String> getNames(List<User> users) {

  return StreamSupport.stream(users).map(user -> user.name()).collect(Collectors.toList());
 
}

After:

public static String[] getNames(User[] users) {

  return J8Arrays.stream(users).map(user -> user.name()).toArray(length -> new String[length]);
 
}

Installation

build.gradle:

repositories {

  jcenter()
  maven {
 url "https://jitpack.io" 
}
 
}
  dependencies {

  compile 'net.sourceforge.streamsupport:streamsupport:1.5.6'
  compile 'net.sourceforge.streamsupport:streamsupport-cfuture:1.5.6'
  compile 'net.sourceforge.streamsupport:streamsupport-atomic:1.5.6'
  compile 'net.sourceforge.streamsupport:streamsupport-flow:1.5.6'
  compile 'net.sourceforge.streamsupport:streamsupport-literal:1.5.6'

//compile 'com.github.streamsupport.streamsupport:streamsupport-pro:-SNAPSHOT' // proguard config for android 
}

or via jitpack:

repositories {

  jcenter()
  maven {
 url "https://jitpack.io" 
}
 
}
  dependencies {

  compile 'com.github.streamsupport.streamsupport:streamsupport:-SNAPSHOT'
  compile 'com.github.streamsupport.streamsupport:streamsupport-cfuture:-SNAPSHOT'
  compile 'com.github.streamsupport.streamsupport:streamsupport-atomic:-SNAPSHOT'
  compile 'com.github.streamsupport.streamsupport:streamsupport-flow:-SNAPSHOT'
  compile 'com.github.streamsupport.streamsupport:streamsupport-literal:-SNAPSHOT'

//compile 'com.github.streamsupport.streamsupport:streamsupport-pro:-SNAPSHOT' // proguard config for android 
}

Proguard

streamsupport.pro

Build

maven

./mvnw clean install

gradle

./gradlew clean assemble

Importing

GIT_COMMITTER_NAME="" GIT_COMMITTER_EMAIL="" git rebase --committer-date-is-author-date 1.5.5 1.5.6 --onto _1.5.5

Release Notes

Release Notes

LICENSE

GPL2, CE (GNU General Public License, version 2, with the Classpath Exception)

Resources

FlxBox2D is a wrapper for Box2D through libgdx. The Box2D is a full JNI wrapper which means there's no garabage collection issues at all and the JNI call overhead is minimal.

Android-Icon-Fonts project contains material and Holo iconic fonts.

Manual ProGuard configuration is not a pleasant task. It requires a lot of time, patience and strong Google-fu to search dark corners of Internet for magic incantations that make ProGuard happy and don't screw up your build. A bottle of alcoholic beverage also comes in handy.

We just want to say "ProGuard this for me, please". And that's what this plugin strives to do.

If you do any serious Android development, you've probably used ProGuard to obfuscate, optimise and shrink your application. In that case it's also very likely that ProGuarding your app has broken your release builds, took a few hours of your time away while pulling your hair out.

Squad leader includes two annotations that you can add to your code to specify that you want to @Keep a class, method or field and it's name. There's also a @KeepName annotation that does the same, but only if the annotated element is actually used in your code.

Android library for detecting and reporting long running SQLite queries.

If some of your queries takes longer than the threshold specified in the CerberusCursorFactory constructor, the report containing the offending query, elapsed query time, stack trace, and the result of EXPLAIN QUERY PLAN sqlite query will be dumped into the logcat.

Intel XDK HTML5 Cross-platform Development Tool provides a simplified workflow to enable developers to easily design, debug, build, and deploy HTML5 web and hybrid apps across multiple app stores, and form factor devices.

Experience Intel XDK - the easy and fast way to get your apps to market.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes