|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.vitals.VitalStatistics
VitalStatistics
holds a set of statistics
for a particular vital sign throughout the useful
life of the vital sign.
Field Summary | |
protected AbstractVitalMeasurement |
highestRecordedMeasurement
Holds the highest recorded measurement. |
protected AbstractVitalMeasurement |
latestRecordedMeasurement
Holds the lowest recorded measurement. |
protected AbstractVitalMeasurement |
lowestRecordedMeasurement
Holds the lowest recorded measurement. |
protected long |
measurementsTaken
Holds the count of all measurements taken. |
protected java.util.LinkedList |
recentlyRecordedAlerts
Holds a collection of the most recently-recorded alerts. |
protected java.util.LinkedList |
recentlyRecordedMeasurements
Holds a collection of the most recently-recorded measurements. |
protected AbstractVitalMeasurement |
summationOfMeasurements
Holds the sum of all recorded measurements. |
protected long |
timeLastAlertDetected
Holds the date/time an alert was found (but not necessarily logged). |
protected long |
timeLastAlertLogged
Holds the date/time of the last alert logged measurement for the statistic. |
protected long |
timeLastStatisticLogged
Holds the date/time of the last logged measurement for the statistic. |
protected VitalSign |
vitalSign
Holds the vital sign the statistics are being collected for. |
Constructor Summary | |
VitalStatistics(VitalSign vitalSign)
Creates a vital statistics set for a vital sign. |
Method Summary | |
protected void |
addRecentlyRecordedAlert(AbstractVitalMeasurement newMeasurement)
Helper method to track the history for recently recorded alerts. |
protected void |
addRecentlyRecordedMeasurement(AbstractVitalMeasurement newMeasurement)
Helper method to track the history for recently recorded measurements. |
protected void |
checkRecentlyRecordedMeasurementForAlerts(AbstractVitalMeasurement newMeasurement,
boolean newHighFlag)
Checks a measurement to see if it generates an alert, and if so, records the alert. |
AbstractVitalMeasurement |
getAverageOfMeasurements()
Returns the average across all measurements taken. |
AbstractVitalMeasurement |
getHighestRecordedMeasurement()
Returns the highest recorded measurement. |
double |
getHistoryMeasurementsTakenPerSecond()
Returns the average number of measurements taken per second, from all measurements recorded in the history collection. |
AbstractVitalMeasurement |
getLatestRecordedMeasurement()
Returns the most recently-recorded measurement. |
AbstractVitalMeasurement |
getLowestRecordedMeasurement()
Returns the lowest recorded measurement. |
long |
getMeasurementsTaken()
Returns the number of measurements taken. |
java.util.Collection |
getRecentlyRecordedAlerts()
Returns the recentlyRecordedAlerts list. |
java.util.Collection |
getRecentlyRecordedMeasurements()
Returns the recentlyRecordedMeasurements list. |
java.util.Date |
getTimeLastAlertWasDetected()
Returns the date the last alert has been detected, or null if no alert has been detected. |
VitalSign |
getVitalSign()
Returns the vital sign the statistics are for. |
boolean |
hasAlertBeenDetectedInRecentMinutes(long minutes)
Detects whether an alert has been detected within the input number of minutes from the current time. |
protected void |
logAlert(AbstractVitalMeasurement newMeasurement,
java.lang.String alertReason)
Helper method to see if the measurement needs to be logged and if so, logs it. |
protected void |
logMeasurement(AbstractVitalMeasurement newMeasurement)
Helper method to see if the measurement needs to be logged and if so, logs it. |
void |
registerMeasurement(AbstractVitalMeasurement newMeasurement)
Adds a measurement to the set of statistics kept. |
boolean |
shouldAlertBeLogged()
Checks to see if a measurement generating an alert should be logged, given its frequency defined in the property file. |
boolean |
shouldMeasurementBeLogged()
Checks to see if a measurement should be logged, given its frequency defined in the property file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected VitalSign vitalSign
protected AbstractVitalMeasurement highestRecordedMeasurement
protected AbstractVitalMeasurement lowestRecordedMeasurement
protected AbstractVitalMeasurement latestRecordedMeasurement
protected AbstractVitalMeasurement summationOfMeasurements
protected java.util.LinkedList recentlyRecordedMeasurements
protected java.util.LinkedList recentlyRecordedAlerts
protected long measurementsTaken
protected long timeLastStatisticLogged
protected long timeLastAlertLogged
protected long timeLastAlertDetected
Constructor Detail |
public VitalStatistics(VitalSign vitalSign)
Method Detail |
public VitalSign getVitalSign()
public java.util.Collection getRecentlyRecordedMeasurements()
public boolean shouldMeasurementBeLogged()
protected void logMeasurement(AbstractVitalMeasurement newMeasurement)
protected void addRecentlyRecordedMeasurement(AbstractVitalMeasurement newMeasurement)
newMeasurement
- public java.util.Collection getRecentlyRecordedAlerts()
protected void addRecentlyRecordedAlert(AbstractVitalMeasurement newMeasurement)
newMeasurement
- public boolean shouldAlertBeLogged()
protected void logAlert(AbstractVitalMeasurement newMeasurement, java.lang.String alertReason)
protected void checkRecentlyRecordedMeasurementForAlerts(AbstractVitalMeasurement newMeasurement, boolean newHighFlag)
newMeasurement
- The measurement about to be added to the
collection of measurements recordednewHighFlag
- Flag telling whether the measurement is
a new high, so the check previously done in the code
doesn't have to be performed again.public boolean hasAlertBeenDetectedInRecentMinutes(long minutes)
minutes
- The number of minutes you want to checkpublic java.util.Date getTimeLastAlertWasDetected()
public void registerMeasurement(AbstractVitalMeasurement newMeasurement)
public AbstractVitalMeasurement getHighestRecordedMeasurement()
public AbstractVitalMeasurement getLowestRecordedMeasurement()
public long getMeasurementsTaken()
public AbstractVitalMeasurement getAverageOfMeasurements()
public AbstractVitalMeasurement getLatestRecordedMeasurement()
public double getHistoryMeasurementsTakenPerSecond()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |