public class AlarmFlood extends java.lang.Object implements java.lang.Runnable, AlarmCategoryListener
Objects of this class records a flood.
When the object is created, it starts a Thread to count each minute and for each minute the important value is the number of received alarms to recognize if a flood starts or finish.
The alarm counted in this context are the annunciated alarms i.e.
| Constructor and Description |
|---|
AlarmFlood(FloodContainer container)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAlarmsInFlood()
Getter
|
long |
getEndTimeOfFlood()
Getter
|
long |
getStartTimeOfFlood()
Getter
|
boolean |
isFloodFinished() |
boolean |
isFloodStarted() |
long |
lengthOfFlood()
The length of a this flood in msec.
|
void |
onAlarm(Alarm alarm)
A new alarm has been received.
|
void |
run()
The thread check every minute the state of the flood and
terminates when the flood finishes.
|
void |
stop()
Stop counting
|
public AlarmFlood(FloodContainer container)
container - The container that owns this objectpublic long lengthOfFlood()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void onAlarm(Alarm alarm)
onAlarm in interface AlarmCategoryListeneralarm - The alarmpublic long getStartTimeOfFlood()
public long getEndTimeOfFlood()
public int getAlarmsInFlood()
public boolean isFloodStarted()
true if a flood startedpublic boolean isFloodFinished()
true if the flood finished
A value of false means that a flood has not finished yet
but it could as well be that it never started.