An Example
Previous    Next    Home    Package    GUI source    Queue class    FindFunc interface    Employee classes

A Reusable Queue class
  1. In this simple example we can add employees of type Programmer to an employee data base (co-existing with numerous other types) and later find those employees either by name or SS#. The employees are held in a Queue class which is general enough to save any eclectic collection of objects, not just employees. If new types of employee are invented, it does not matter, they can be stored in Queue objects without changing the code. If a new type of search should be invented it merely needs to implement the FindFunc interface and the Queue class will have no problem with it.