It's kind of define what's the topic this week article. Cuz technically speaking, it's dun really belong to any particular programming concept or code knowledge. It's more to how Java8 can be used on day to day dev process. You would say, Oh tons of Java program out there live just fine by not adopting … Continue reading Stream(9): Practical Stream
Stream(8): Partitioning
Similar to Grouping feature offered by Collectors. But do noted that only mostly two groups exist in resulting Map. So in this way You would always got the result object as Map<Boolean, obj> type and of course is Boolean instead of boolean, Java dun take primitive type for Collection. Just a extra content, Grouping … Continue reading Stream(8): Partitioning
Stream(7): Grouping
Grouping is another things gonna save you so much effort when using it on the right way I would say, what is the right way? Let’s you have a List Which then we need to divide into separate List by Calories for further processing, what would we do? First by set up a … Continue reading Stream(7): Grouping
Stream(5): TerminateOperation?
Today’s one is more a little personally would see a lot of usage on daily Dev cycle. We do loop, loop after loop - tones of loop per day. Loop through a DataSet, extract the juicy bit or simply print it out. Haven’t you ever got that requirement which is only show first xxx rows … Continue reading Stream(5): TerminateOperation?
Stream(3): FlatMap
Which is such a confusing topic for when first walk into Java8 world. Got told that map is similar to filter( ) operation to convert a stream candidate to another class then continue the journey. But flatmap( ) on the other hand is when the inflation happen, by in following example I would demonstrate how … Continue reading Stream(3): FlatMap
Short circut evaluation
Hi all, this a Java trick session, which is distinct from my usual series which explain J2SE code byte by byte. Concept or thought that emerged during my 9-6 Java dev life. And it's fun enough to share? Any way today's topic is about Short circuit evaluation, or some of u guys may call … Continue reading Short circut evaluation
Lambda (5): “This” under the context of Jvava 8 lambda
Today I wanna talk about how keyword “This” can have a totally different definition, under the context of lambda function on Java 8. As you all may notice, lambda expression allow developer to pass method with specific parameter and type of result into another method as a parameter. Usually it can be done on one … Continue reading Lambda (5): “This” under the context of Jvava 8 lambda
Lambda (4): Functional function interface
Hows the exploring with the functional interface going? Today, we would talk about one of the stock interface come with J2SE (Function). Yes, it’s call function, the only bit special compare to other interface is that it come with magical method <Andthen() || Compose()>. By making good use of those two methods. It allow Dev … Continue reading Lambda (4): Functional function interface
Lambda (3) Function as an object (The JS way coding?)
This week gonna be a short one, mainly extends the concept we talked last week. As Java.util.function got introdcued on J2SE. It provide a package for default lambda interface, it's out of the box, can implement it straight away with no hesitation. But this week we would focus on the way of writing lambda code, … Continue reading Lambda (3) Function as an object (The JS way coding?)
Lambda (1) – Basic
Reckon it gonna be pretty lengthy series by exploring the true beauty of lamda / Functional programming. As such a mystery for me who grow up from Java side, OOP got taught from day one. The first lecture on my CSCI101 classes, in my case is CSCI114 from DFS if recalled correctly. Everything in … Continue reading Lambda (1) – Basic
When constant not staying constant?
It would be better to read Sebastian's article first, to get the insight of it. Cuz this blog is mainly the extends of it. But first lets clarify several concept first What does a private final field mean? Private mean the scope of access is restricted into the class itself. Only method call within the … Continue reading When constant not staying constant?
Stream(6): Reducing && Joining
Welcome to the Java8 Stream advanced series, in this series of article we would dig deep into Stream. No just how to code and the usage. But more to how to integrate into our Dev cycle. We not just learn things, but also put into use. This article would focus on two main things, … Continue reading Stream(6): Reducing && Joining
Stream(4): NumericStream
Today’s one would be a quick one. After a while exploration of Stream() API. You may gradually understand how wonderful can .map( ) offer you, so as reduce( ). Nearly all accumulate operations can be performed on reduce( ) which we introduced before. However as some of you guys may notice, Stream actual got extends … Continue reading Stream(4): NumericStream
Stream(2): Reduce
Reduce, which is one of way when performing accumulate operation on Stream, Stream would perform operation with the current element and the accumulate result from previous calculation. The whole thing by itself is sequential and not applicable to multiple thread, unless you have declare how Stream should glue partial result together. Which would be discuss … Continue reading Stream(2): Reduce
Stream(1): Find Match
Welcome to the series of Stream. Stream is one of the new functionality offer by Java8 along side with Lambda in order to adapt functional programming pattern. Hence this series of article is intend for reader who have the basic understanding of Lambda, beginner are welcome to check on the Lambda series wrote on here. … Continue reading Stream(1): Find Match