#Java Advanced Stream Manipulation
45 messages · Page 1 of 1 (latest)
Hey, @lavish mist!
Please remember to /close this post once your question has been answered!
It has to be done only using Stream but u can use various data structure
These are my answer for :
- get distribution of match per month
- get the top5 cities where most match occured
where on second solution Match::getVille is Match::getCity (im french, Ville=City)
Here is the csv file
I can provide a try catch method to import data
hellllo
Hello sir
Nope, it has to be done using Stream
This is what makes it hard haha
I have a method that gives me an ArrayList<String> with both team that played for a specific match, this i can use
So i could have a map {[team1, team2]=nb_match, [team2, team3]=nb_match, ...}
But then i have no idea how to get the maximum value
Match(date, home_team, away _team, home_score, away_score, tournament, city, country) what are the data type of all this
oh nvm
Yeap
get the amount of goal scored
get the number of match played by Belgium since 2000
can u show the code how u did this two i dont really know much about stream but i will to help
yes
it uses Lambda expressions
for total amount of goal scored
were e.getNb_buts_marque_equipe_dom() is just e.getHome_Score()
and e.getNb_buts_marque_equipe_vis() is just e.getAway_Score()
This for Belgium
where isPlaying simply returns a boolean if a match has the specific team as home or away team
oh
static long l;
public static void main(String[] args) {
List<Integer> list = List.of(1,3,4,1);
list.stream().forEach(e-> l = l+e);
System.out.println("total is: "+l );
}
is this correct way of getting the total??
Sorry dude but I ain't gonna give you a course on basic stream manipulation, you can find this on web really fast and for my advanced question i'm not quite sur that if you start from there u can answer :/
by team- home team away team or city ??
By team !
So it should aggregate the number the team has been home_team and the number the team has been away_team
Found a solution !