|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.model.Source
A source maintains the volume of water it holds inside. It also knows its minimum and maximum volume, as well as the maximum natural volume of water it can absorb. It is the data model of water source.
Field Summary | |
private double |
currentVolume
Volume of water currently present in the source. |
protected static double |
HIGH_VOLUME_LIMIT
The highest possible volume of water in the source, in liters. |
protected static double |
LOW_VOLUME_LIMIT
The lowest possible volume of water in the source, in liters. |
protected static double |
MAX_VOLUME_DELTA_PER_SECOND
The maximum quantity of water that can come to the source from the outer environment, in liters per second. |
protected static double |
NATURAL_MAX_VOLUME_LIMIT
The maximal volume of water (in liters) that the source can ever absorb. |
protected static double |
PUMP_POWER_PER_SECOND
The quantity of water (in liters per second) pumped out from the source in one second, if the pump is running. |
private int |
sourceNumber
The number of the source. |
Constructor Summary | |
protected |
Source(int sourceNumber)
Creates a new source object and sets its volume to the exact middle of possible values. |
Method Summary | |
protected void |
decreaseVolume(double delta)
Decreases the volume of water in the source. |
protected int |
getNumber()
Returns the source's number. |
protected double |
getVolume()
Reports the current volume of water in the source. |
protected void |
increaseVolume(double delta)
Increases the volume of water in the source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final double LOW_VOLUME_LIMIT
protected static final double HIGH_VOLUME_LIMIT
protected static final double NATURAL_MAX_VOLUME_LIMIT
protected static final double PUMP_POWER_PER_SECOND
protected static final double MAX_VOLUME_DELTA_PER_SECOND
private final int sourceNumber
private double currentVolume
Constructor Detail |
protected Source(int sourceNumber)
sourceNumber
- Number of the source.Method Detail |
protected int getNumber()
protected void increaseVolume(double delta)
delta
- The amount of water that is added to the source.protected void decreaseVolume(double delta)
delta
- The amount of water that is taken away from the source.protected double getVolume()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |