Homework: WaitingLine Family Interface Design
This homework is necessary preparation for the lab. Make sure you type your answers and you bring the files to the lab so that you will not have to waste time entering them during the lab.
-
For this homework, you will design the interfaces for a new component family,
WaitingLine.WaitingLineis trying to capture the idea of a waiting line like you might encounter at a restaurant. Customers upon arriving at the restaurant have their name added to the end of the waiting line; they can ask for their position in the waiting line and perhaps later decide to leave and ask to be removed from the waiting line. Customers are seated in the order in which they are added to the waiting line. Note that a restaurant is just one example of where such a waiting line may be useful. There are many other situations where waiting lines occur and your components should be applicable to such other situations as well.WaitingLineis similar toQueuein that it provides a FIFO (first-in-first-out) order of processing, but differs fromQueuein the following significant ways:- The entries in a
WaitingLinemust be unique. - It must be possible to remove a given entry known to be in a
WaitingLine. - It must be possible to find the position of a given entry in a
WaitingLine.
Starting from the interfaces
Standard,QueueKernel, andQueue, design new interfacesWaitingLineKernelandWaitingLineto capture the behavior of a waiting line. For this homework, turn in PDF print-outs of theWaitingLineKernel.javaandWaitingLine.javafiles. - The entries in a