CSE1030 2006-07W Lab2 January 22 - 26

In this lab, you will implement a Television class; a link to its API is given below. The API for the class you create should be identical to the one given below.

Each television has a control device of type RemoteControl; the API and .class file for the RemoteControl class are given below. It is through this device that the power is turned on/off and the volume and channel are set, and so on. In other words, you can only control the television through the interface provided by the controller.
The design choice made here is to have the controller as a component of the television (see the CSE1020 text, p. 293/294). This means that its lifetime is the same as that of the television of which it is a component: it is created when the owning television instance is created and is available for garbage collection at the same time as its owning television instance.
The controller is also private. This means, for example, that, when changing channels, a user does not directly invoke a channel changing method on the controller, but instead invokes such a method on the television instance. The user should never gain direct access to the controller.

To keep the lab shorter and simpler, instance methods to change the volume and channel, etc. have been omitted from the Television API. A more complete implementation of Television would have these. Of course, they would simply call the appropriate method of the (private) controller.