filmov
tv
Java Stream API : What is a Short Circuiting Stateful Intermediate Operation ? | Java 8 sort() | EP3

Показать описание
In this video we will learn about, What is a Short Circuiting Stateful Intermediate Operation in Java 8 Stream API ? We will explore the difference between stateful and stateless intermediate operations. We will look into short circuiting methods like limit(), takeWhile() and, we will debug the same.
In our stream api tutorials so far, we will understood about one of the Java 8's new features called Stream API.
The java stream api introduced in java 8, changed the way we write and read java code.
Java Stream API is an absolute beast when it comes to data processing as it enables the scope of processing the data in a declarative approach. It opens a way to fusion multiple methods by doing method chaining and gives us a way to write lambda expressions as most of the Java streams methods accepts lambda as a parameter. Thus we can reduce our traditional loops/condition checks / conversion code and significantly improve our code readability.
In this Java Stream api tutorial, We will discuss about the followings :
1. Stream API in Java 8
2. sort() in Java Stream
3. Stateful Operations : Order of Execution
4. Stateful vs Stateless - Java doc
5. limit() as a short circuiting stateful intermediate operation
6. skip() in java 8
7. distinct() in java 8
8. takeWhile() in java 8
TIMESTAMP
------------------------
00:00 - Stream API in Java 8 recap
04:35 - sorting in java
09:56 - What is a stateful operation in Java 8 Stream ?
20:25 - How Java 8 Sorted works under the hood ?
24:53 - infinite Stream - The Iterate() method
34:27 - A stream api interview question
40:39 - Stream API : bringing in takeWhile()
44:25 - What is a short circuiting operation in Stream API
51:31 - skip() in Java 8 Stream
53:32 - distinct() in Java 8 Stream API
54:57 - A thought on takeWhile()
----------
The Story So far :
As we have discussed, The java Stream api is not a data structure but it is used to process a collection of objects.
There are two kind of operations used in Stream API.
One type of operation is called Intermediate operation. Intermediate operations are used to perform operations like filtration of elements , element transformation to another type, limiting data in a stream pipeline etc. After performing any intermediate operation over a stream, we again get a Stream Object back.
One point to note here is , the Streams in java are lazy. They do nothing until a terminal operation invoked over them. So terminal operations are going to trigger or start a stream , helps the stream to start processing the data in the pipeline.
Methods like filter(),map(),limit() are called intermediate operations, where as the methods like forEach(),collect(),count() are called terminal operations.
Another key point to remember is , any intermediate operations that we perform over a stream doesn't modify the source stream object. So streams in java are immutable and any intermediate operations performed over a stream object returns a new stream.
Here one thing to keep in mind is , Once we done consuming data from a stream, the stream pipeline considered as consumed and wont be reusable again.
--------------
As per the java doc the intermediate operations are further divided into two things. One thing is called Stateful operation and another is stateless intermediate functions.
One more thing is few operations are short circuiting in nature.
In this java 8 stream api foundation tutorial, we will discuss everything about it in detail.
For more free/paid courses visit
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
Watch my new Hello spring boot series
Watch Spring boot Hot topics
spring core
spring mvc
spring mvc intermediate
Spring JDBC
spring live project
SPRING SECURITY COURSE[NEW]
For more courses visit
Any time you are getting stuck with issues, Feel free to ask for support.
you can ping me on my Facebook page
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
you can ask for support in my website forum
Follow me on Insta
In our stream api tutorials so far, we will understood about one of the Java 8's new features called Stream API.
The java stream api introduced in java 8, changed the way we write and read java code.
Java Stream API is an absolute beast when it comes to data processing as it enables the scope of processing the data in a declarative approach. It opens a way to fusion multiple methods by doing method chaining and gives us a way to write lambda expressions as most of the Java streams methods accepts lambda as a parameter. Thus we can reduce our traditional loops/condition checks / conversion code and significantly improve our code readability.
In this Java Stream api tutorial, We will discuss about the followings :
1. Stream API in Java 8
2. sort() in Java Stream
3. Stateful Operations : Order of Execution
4. Stateful vs Stateless - Java doc
5. limit() as a short circuiting stateful intermediate operation
6. skip() in java 8
7. distinct() in java 8
8. takeWhile() in java 8
TIMESTAMP
------------------------
00:00 - Stream API in Java 8 recap
04:35 - sorting in java
09:56 - What is a stateful operation in Java 8 Stream ?
20:25 - How Java 8 Sorted works under the hood ?
24:53 - infinite Stream - The Iterate() method
34:27 - A stream api interview question
40:39 - Stream API : bringing in takeWhile()
44:25 - What is a short circuiting operation in Stream API
51:31 - skip() in Java 8 Stream
53:32 - distinct() in Java 8 Stream API
54:57 - A thought on takeWhile()
----------
The Story So far :
As we have discussed, The java Stream api is not a data structure but it is used to process a collection of objects.
There are two kind of operations used in Stream API.
One type of operation is called Intermediate operation. Intermediate operations are used to perform operations like filtration of elements , element transformation to another type, limiting data in a stream pipeline etc. After performing any intermediate operation over a stream, we again get a Stream Object back.
One point to note here is , the Streams in java are lazy. They do nothing until a terminal operation invoked over them. So terminal operations are going to trigger or start a stream , helps the stream to start processing the data in the pipeline.
Methods like filter(),map(),limit() are called intermediate operations, where as the methods like forEach(),collect(),count() are called terminal operations.
Another key point to remember is , any intermediate operations that we perform over a stream doesn't modify the source stream object. So streams in java are immutable and any intermediate operations performed over a stream object returns a new stream.
Here one thing to keep in mind is , Once we done consuming data from a stream, the stream pipeline considered as consumed and wont be reusable again.
--------------
As per the java doc the intermediate operations are further divided into two things. One thing is called Stateful operation and another is stateless intermediate functions.
One more thing is few operations are short circuiting in nature.
In this java 8 stream api foundation tutorial, we will discuss everything about it in detail.
For more free/paid courses visit
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
Watch my new Hello spring boot series
Watch Spring boot Hot topics
spring core
spring mvc
spring mvc intermediate
Spring JDBC
spring live project
SPRING SECURITY COURSE[NEW]
For more courses visit
Any time you are getting stuck with issues, Feel free to ask for support.
you can ping me on my Facebook page
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
you can ask for support in my website forum
Follow me on Insta
Комментарии