public class Throttle
extends java.lang.Object
Constructor and Description |
---|
Throttle(int size)
Construct a Throttle with a specified number of on positions.
|
Modifier and Type | Method and Description |
---|---|
double |
getFlow()
Get the current flow of this Throttle.
|
boolean |
isOn()
Check whether this Throttle is on.
|
void |
shift(int amount)
Move this Throttle's position up or down
|
void |
shutOff()
Turn off this Throttle.
|
public Throttle(int size)
size
- The number of on positions for this new Throttle.
java.lang.IllegalArgumentException
- if size less than or equal to 0public double getFlow()
public boolean isOn()
public void shift(int amount)
amount
- The amount to move the position up or down (a positive amount moves the position up;
a negative amount moves it down).
public void shutOff()