Newer
Older
class ElectronicApplicance {
boolean switch;
double timeLimit;
int sound;
abstract void turnOn();
abstract void turnOff();
abstract boolean isTurnedOn();
}
class Television implements ElectronicApplicance{
boolean switch;
double timeLimit;
String content;
Television() {
send packet to TV requesting its state
receive packet for switch, timeLimit, content
set all fields accordingly
send packet to TV telling it to turn on
if ack received, switch = true
}
void turnOff() {
send packet to TV telling it to turn off
if ack received, switch = false
}
void setContent(String) {
content = String;
}
void setTimeLimit(double) {
timeLimit = double