Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Eclipse Collections Kata

Eclipse Collections Kata

C2c1c3d25e26fd444b59e47744c932ba?s=128

Chandra Guntur

July 06, 2016
Tweet

Transcript

  1. ECLIPSE COLLECTIONS FUNCTIONAL, FLUENT, FRIENDLY & FUN! CHANDRA GUNTUR @CGuntur

    
 http://linkedin.com/in/chandraguntur https://github.com/c-guntur
  2. EVOLUTION OF THE
 ECLIPSE COLLECTIONS FRAMEWORK • In development as

    GSCollections, since 2004. • Originally open-sourced as GSCollections on GitHub, in 2012. • Kata to teach usage of GSCollections, developed in 2007. • Kata (with solutions) hosted as a parallel repo on GitHub, in 2012. • FWK re-branded as Eclipse Collections and again open-sourced in 2015. • Renamed to encourage external contributions with a easy use license. • Kata (with solutions) is a parallel Eclipse-Collections-Kata (2015)
  3. Eclipse Collections: is a collections framework for Java. has JDK-compatible

    List, Set and Map implementations with a rich API. has additional types not found in the JDK like Bags, Multimaps. has set of utility classes that work with any JDK compatible collections, arrays, Maps or Strings. is inspired by the Smalltalk collection framework iteration protocols. started off as an open source project on GitHub called GS Collections. presented at JVM Language Summit(2012), JavaOne (2014) among several other impactful conferences. has several articles and performance benchmarks by authors as well as by users showing positive results.
  4. Eclipse Collections main features: bring fluency in declarations as well

    as initialization. separate mutable and immutable collections from the root, unlike JDK's implementations. add collections, features and utilities missing in Java collection framework. memory efficient containers. primitive containers. support several iteration styles: serial/parallel or eager/lazy.
  5. RichIterable Readable Interface Mutable Interface Immutable Interface MutableBag, MutableList, etc.

    ImmutableBag, ImmutableList, etc. Design Concepts
  6. Hierarchy © 2014 Goldman Sachs. All rights reserved.

  7. Eclipse Collections iteration patterns Filtering patterns: select reject partition Transforming

    patterns: collect flatCollect groupBy Short-circuit patterns: detect anySatisfy allSatisfy Generic action patterns: forEach injectInto
  8. List of unique operations in RichIterable in Eclipse Collections v

    7.1.0 aggregateBy collectWith max sumOfDouble aggregateInPlaceBy contains maxBy sumOfFloat allSatisfy containsAll min sumOfInt allSatisfyWith containsAllArguments minBy sumOfLong anySatisfy containsAllIterable noneSatisfy tap anySatisfyWith count noneSatisfyWith toArray appendString countWith notEmpty toBag asLazy detect partition toList chunk detectIfNone partitionWith toMap collect detectWith reject toSet collectBoolean detectWithIfNone rejectWith toSortedBag collectByte each select toSortedBagBy collectChar flatCollect selectInstancesOf toSortedList collectDouble groupBy selectWith toSortedListBy collectFloat groupByEach size toSortedMap collectIf groupByUniqueKey sumByDouble toSortedSet collectInt injectInto sumByFloat toSortedSetBy collectLong isEmpty sumByInt collectShort makeString sumByLong
  9. ECLIPSE COLLECTIONS CODE KATA … AN EXERCISE IN PROGRAMMING WHICH

    HELPS A PROGRAMMER HONE THEIR SKILLS THROUGH PRACTICE AND REPETITION … DAVE THOMAS AUTHOR, THE PRAGMATIC PROGRAMMER I HEAR, I KNOW. I SEE, I REMEMBER. I DO, I UNDERSTAND. CONFUCIUS CHINESE TEACHER/PHILOSOPHER
  10. FUN REFERENCE TO MR.MIYAGI

  11. USE / CONTRIBUTE / ASK ? Eclipse Project: https://projects.eclipse.org/proposals/eclipse-collections Project

    Home(& API Documentation): https://www.eclipse.org/collections Framework GitHub: https://github.com/eclipse/eclipse-collections Kata GitHub (& solution branch): https://github.com/eclipse/eclipse-collections-kata Performance (EclipseCon “Eclipse Collections by Example” 2015): https://goo.gl/rIjkJ2 StackOverflow: http://stackoverflow.com/questions/tagged/eclipse-collections CHANDRA GUNTUR @CGuntur 
 http://linkedin.com/in/chandraguntur https://github.com/c-guntur