oop-labs-collection/labs/6/Appliance.java

34 lines
649 B
Java
Raw Normal View History

public class Appliance {
private boolean powerConnected;
public Appliance(boolean connected) {
this.powerConnected = connected;
}
public boolean getPowerState() {
return powerConnected;
}
public void plug() {
powerConnected = true;
}
public void unplug() {
powerConnected = false;
}
public float min(float v1, float v2) {
return v1 <= v2 ? v1 : v2;
}
public float max(float v1, float v2) {
return v1 >= v2 ? v1 : v2;
}
public float getPowerConsumption() {
return 0f;
}
public void step(float seconds, float ventRPM) {}
}