baseball2
Interface ILeague


public interface ILeague

Information about an entire collection of baseball2 teams.
In addition to the methods specified here, the class should provide a constructor which takes one parameter, a file identifier. The file is expected to contain information about teams.


Method Summary
 int addHitterInformation(java.lang.String fileID)
          Read player information from a file and remember it.
 int addPitcherInformation(java.lang.String fileID)
          Read player information from a file and remember it.
 void printAllStarBallot()
          List all players (except pitchers), in order of their positions.
 void printMVPList()
          List players in descending order of "value" (in baseball terms).
 void printPlayers()
          Print all the players in order, one per line.
 void printPlayers(java.lang.String teamName)
          Print in order, one per line, the players who play for the given team.
 void printTeams()
          Print the teams in order, one per line.
 

Method Detail

addHitterInformation

public int addHitterInformation(java.lang.String fileID)
Read player information from a file and remember it.

Parameters:
fileID - identifier (local name or URL) of a file containing information about players who are hitters.
Returns:
the number of players added.

addPitcherInformation

public int addPitcherInformation(java.lang.String fileID)
Read player information from a file and remember it.

Parameters:
fileID - identifier (local name or URL) of a file containing information about players who are pitchers.
Returns:
the number of players added.

printTeams

public void printTeams()
Print the teams in order, one per line.


printPlayers

public void printPlayers()
Print all the players in order, one per line.


printPlayers

public void printPlayers(java.lang.String teamName)
Print in order, one per line, the players who play for the given team.

Parameters:
teamName - the name of a team. The name should treated case-insensitively.

printMVPList

public void printMVPList()
List players in descending order of "value" (in baseball terms). We define value as folows: all pitchers are more valuable than any hitter. Within the hitter category, value is determined by batting average (higher is better). Among pitchers, value is determined by ERA (lower is better).


printAllStarBallot

public void printAllStarBallot()
List all players (except pitchers), in order of their positions. The positions should be in alphabetical order by position codes. Within a given position, list the players in alphabetical order (in the usual way).