Definition: This is a link between a city, state, and zip code.  Other countries have similar systems for postal codes which link towns and providences or other political boundaries to a postal code.  This saves time when entering new bowlers, as only the postal code is required, and the remaining items are entered automatically.  It also saves typing mistakes.  The PostalCode entry is a String because, although some codes are purely numbers, that isn’t always the case.  Even the US has the +4 addition to the zip code which precludes using an integer or other number.

I make no attempt to format these fields.  Since the postal code can contain non-numeric characters, I won't use it as the ID value, which could be possible with US Zipcodes.

The Postal Codes must be available prior to Addresses because the Address objects have a PostalCode object as a part of it.  I debated about making the PostalCode object as completely separate from the Address, but realized that an address is not unique or complete without the postal code included.  For example, two different bowlers could live at 123 Main Street, but in different postal codes.  These are completely separate addresses, and should not be confused with each other.  The downside of this is that the address becomes dependent on the postal code.  That means the postal code must be known before the address can be looked up.  This is the reverse of normal address entry which has the postal code as the last item entered.

Variables:  Variables here

  Modifier Class Name Value
    Integer serializableVersionUID 1234567

Characteristics:

  Tic name object
  City String
State String
PostalCode String

Requirments:

 
  • Ticable
  • HasID, but might not be used.
  • Serializable
  • Comparable and Comparator
  • Observable
  • new, to create a new instance using Tic default values.
  • RecordIO

Required Methods:

 
  • A no argument constructor.
  • Setters and getters for the characteristics.
  • The compare(Object, Object), compareTo(Object), and equals(Object) methods. (Comparable and Comparator)
  • Save() and Load() methods for saving/loading to a delimited file. (RecordIO)
  • Get a specific object using the ID.  The object may be in memory or need to be retrieved from a data store (file). (HasID)