zcs-cs / Baseball-Reporter

The 2014-2015 AP Computer Science A class's final project that analyzes baseball statistics and compiles an automated news report.
GNU General Public License v2.0
0 stars 0 forks source link

On the Parallel Structuring of Player Data #10

Open Hunter-Bobeck opened 9 years ago

Hunter-Bobeck commented 9 years ago

EXPLANATION

You guys may know I am developing BaseballData, the class you will use to access data you have specified as being required. My job is to retrieve this data from the JSON structure file in an encapsulated manner (such that you guys don't have to worry about using the JSON methods directly).

For this data retrieval goal I am developing BaseballData by, the player statistics will need to be returned in a parallel structure... Each team has a set of player statistic arrays. For example, one that returns a String[] of player names, one that returns an int[] of player bats, and so on. Each array will be parallel, meaning one player's set of statistics is identified via an index integer that applies to each of the respective arrays.

What this means on your end is that currently the plan is to simply access the player statistic arrays I provide you in method form by means of iterating through the index (effectively iterating through each player each index represents). So if you want to name the player with the most bats, you would first define an int[] with my players bats method, then find the index of its greatest value, then call that index of my player names method. If you feel like it would make accessing player statistics repeatedly simpler, you may wish to make a Player, Pitcher, or whatever class of objects corresponding to the indeces of these arrays, containing relevant respective statistics.

EXAMPLES

Names:

i 0 1 2 3 4 5
name Rodriguez Man Dork Example Shmuck Hitter Mad Batter Crazy Sam Smiley Face

Bats:

i 0 1 2 3 4 5
bats 4 8 0 2 70 0

Innings Pitched:

i 0 1 2 3 4 5
inningsPitched {} {} {4, 5} {} {2} {9}