A.7. The Teams Class

 // Teams.java package nfl.original; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.*; public class Teams { // This class is a Singleton private static Teams teams = new Teams(); public static Teams getHandle() {return teams; } // Two views of the same data private Map teamMap = new HashMap(); private List teamList = new ArrayList(32); public List getTeamList() {return teamList; } // Constructor private Teams() { // Create AFC Teams Team bal = new Team("Baltimore", "Ravens"); bal.setConference(Conference.AFC); bal.setDivision(Division.AFC_CENTRAL); teamList.add(bal); Team buf = new Team("Buffalo", "Bills"); buf.setConference(Conference.AFC); buf.setDivision(Division.AFC_EAST); teamList.add(buf); ...

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.