It is a solution to the workshop exercise at Expertalk meetup event
- The exercise is to analyse the 'Loksabha election 2014' results using Java 8 features.
- For simplicity, considered only Maharashtra state.
- Clone the project, better option is to fork it
- Run gradle build command from project root directory
- gradle clean build
- gradle cleanIdea idea
- Open the project in Intellij Idea, that's it.
It has below two modules
- data - This module provides the raw election data, it reads the csv file and creates list of
at.election.Result, which is accessed asat.election.ElectionResult.instance.getResult() - analyzer - Analyzer uses data module to get ElectionResult and analyzes it to produces meaningful statistics, check out below classes
- at.election.ElectionResultStatistics.java (present in test folder), this is how a Analyzer module's client will look like.
- at.election.ResultAnalyzer.java (present in main folder), it is responsible to produce domain specific api's on top of raw election result data, to see some meaningful statistics.
- List the election result
- List the election result for Pune
- List it down!
- It is more clear if I see it sorted by Votes in descending order
- Lets remove the noise, I am interested in top 5
- Can I see just the runner up?
- Lets do similar to the Mumbai's result (same steps as 2)
- List number of candidates per party
- List winners per constituency
- Time to see, party wise performance (party wise won seats), yay!
- Total votes in constituencies
- Runner ups show, party wise runner up seats
- Party wise vote share
- Close Fights
- One Sided Contest
- Install Java 8, latest version
- Setup Intellij Community edition 13.1.3 or latest, its free to use and reason is, it has the best support for Java 8 as of now.
- You can very easily setup the project in intellij idea without any build tool, as it is not using any third party dependency, it just uses java 8 jdk and junit.
- If you plan to use gradle, make sure it is latest(1.11 or above), it is optional because of point 3.