league-statistics-java-streams 1
What are you going to learn?
- Use Java 8 Stream API.
- Understand method references.
- Use lambda expressions.
- Understand the practical usage of the Model-View-Controller design pattern.
Implement the 'Season' class, where all matches are be played on a peer-to-peer basis using the 'League' team collection.
- The @playMatch() method provides the result of a match played between two teams. It increments the Wins, Losts, or Draws value of the teams.
- The @scoredGoals() method returns the number of goals scored by a team in one match. The method contains the logic of the scoring chance of each player. The method increments the Goals stats of players.
- The @playAllGames() method contains the logic of all matches played in one round. Every team has to play a match against every team exactly once.
Implement the methods in League Statistics class using Streams.
- All methods in League Statistics class are public static methods.
- No loops (while, do-while, for, foreach) are used in League Statistics class.
- All methods in League Statistics class are single-line return methods, and consist of just streams, lambda expressions, and method references.
Implement the Display class with all necessary methods for creating a console view for the league statistics.
- Methods are implemented for displaying the following.
- A table with name, points, goals, wins, draws, losses columns.
- Single match results.
Footnotes
-
This exercise is an excerpt from my Full Stack Development course. ↩