2.5. The Teams and Games Container Classes
As soon as we start trying to process the data in the Team and Game classes, we will realize that we need to operate on various subsets of the data. We'd like to know what teams are within the NFC West, or which games played by the New York Jets were within its own division. So two new classes, Teams and Games, were created to be containers for all the Team objects and all the Game objects, respectively, and to provide methods for answering various queries about the data. The Games class includes in its constructor all the data for games played during the 2000 NFL season, which is loaded into an ArrayList. There are then methods to return all games, division games played by a team, conference games played ...
Get J2EE™ and JAX™: Developing Web Applications and Web Services now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.