Git Product home page Git Product logo

java8-streaming's Introduction

java8-streaming

playing with functional java8 style streaming api.

actual output

25000.0
28000.0
28000.0
30000.0

total sum is 201000.0
max product price is 90000.0
min product price is 25000.0
productPriceSet is [25000.0, 28000.0]
productPriceMap is {1=HP Laptop, 2=Dell Laptop, 3=Lenevo Laptop, 4=Sony Laptop, 5=Apple Laptop}
productPriceList is [90000.0]
Now parallelizing...
25000.0
28000.0
28000.0
30000.0
total sum is 201000.0

max product price is 90000.0
min product price is 25000.0
productPriceSet is [25000.0, 28000.0]
productPriceMap is {1=HP Laptop, 2=Dell Laptop, 3=Lenevo Laptop, 4=Sony Laptop, 5=Apple Laptop}
productPriceList is [90000.0]
Creating stream from collection, set or array...
JAVA
J2EE
Spring
Hibernate
JAVA
J2EE
Spring
Hibernate
JAVA
Hibernate
J2EE
Spring

Array can also be a source of a Stream...
a
b
c
a
b
c
b
c
from streamBuilder...
a
b
c
From Stream.generate()...
element
element
element
element
element
element
element
element
element
element
From Stream.iterate()...
1
3
5
7
9
Stream of File...
// Attention, file not provided, use your own file!
2018/05/06 20:54:42,200 WARN BaseVisitor There were configuration errors!
LoosePackageCoupling: No packages or classes specified

2018/05/06 20:54:42,200 WARN BaseVisitor There were configuration errors!
LoosePackageCoupling: No packages or classes specified

Stream of Primitives...
1
2
1
2
3
0.050415604442980655
0.47084556420331924
0.24412032084607604

sorting a hashMap by value
{b=10, c=12, d=20, a=21}

reading historico_euromillones.csv sorted by total_2017, 7 values...
EMPojo [number=17, total=131, total_2017=16, total_2018=15]
EMPojo [number=30, total=127, total_2017=16, total_2018=7]
EMPojo [number=20, total=119, total_2017=14, total_2018=12]
EMPojo [number=4, total=132, total_2017=13, total_2018=10]
EMPojo [number=10, total=125, total_2017=13, total_2018=6]
EMPojo [number=19, total=126, total_2017=13, total_2018=3]
EMPojo [number=27, total=121, total_2017=13, total_2018=8]

reading historico_euromillones.csv sorted by total_2018, 7 values...
EMPojo [number=15, total=126, total_2017=9, total_2018=17]
EMPojo [number=17, total=131, total_2017=16, total_2018=15]
EMPojo [number=23, total=135, total_2017=10, total_2018=15]
EMPojo [number=44, total=138, total_2017=13, total_2018=14]
EMPojo [number=48, total=109, total_2017=11, total_2018=14]
EMPojo [number=31, total=115, total_2017=13, total_2018=13]
EMPojo [number=50, total=140, total_2017=11, total_2018=13]

java8-streaming's People

Contributors

alonsoir avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.