Posts

Showing posts from October, 2013

Java 8 - Using Parallel Streams

Java 8 is not slated to come out until Spring 2014, but the features are so enticing that I just had to download the snapshot, and give it a test run. After messing with python the past few weeks the Java 8 feature that I am most looking forward to is lambda support. The second feature I'm digging is the new Stream API. Now these are both very useful APIs on their own, but I really like how Python uses them with the functions filter, map, and reduce. You can read about that here if you'd like. Java 8 provides the same functionality, but it is a bit more verbose. On the plus side, it gives you a few extra useful features that Python does not. (At least that I know of, I'm a Python n00b.) Note: All example code can be found here. My first test was just a few simple filters, and maps. public void test1() { List strings = Arrays.asList( "One","Two","Three","Four","Five"); List longerThanThree =