|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.vitals.AbstractVitalMeasurement
AbstractVitalMeasurement
is a class that holds a
measurement of a vital sign, such as number of milliseconds to
execute a task or requests per second. This class is abstract
to be flexible to accommodate any type of vital sign capture in
a subclass.
Field Summary | |
protected java.util.Date |
dateCaptured
Captures the date of the measurement. |
protected java.lang.String |
measurementUnit
Holds the measurement unit to be displayed. |
protected java.lang.String |
message
Holds an optional message that can be attached to the measurement. |
Constructor Summary | |
AbstractVitalMeasurement()
|
Method Summary | |
abstract AbstractVitalMeasurement |
add(AbstractVitalMeasurement measurement)
Adds one measurement to another, so it can be summed for operations like averaging. |
protected void |
checkMeasurementType(java.lang.Object measurement)
Helper method to check the type of measurement and make sure it is not null and alike. |
abstract AbstractVitalMeasurement |
divideBy(double divisor)
Divides the measurement by the value input to perform operations like an average. |
java.util.Date |
getDateCaptured()
Returns the dateCaptured. |
java.lang.String |
getMeasurementUnit()
Returns the measurementUnit. |
java.lang.String |
getMessage()
Returns the message held in the vital measurement. |
VitalSign |
register(java.lang.String vitalKey)
Registers the current measurement with a vital sign according to the key given as input. |
void |
setMeasurementUnit(java.lang.String measurementUnit)
Sets the measurementUnit. |
void |
setMessage(java.lang.String message)
Sets a message in the measurement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
protected java.util.Date dateCaptured
protected java.lang.String measurementUnit
protected java.lang.String message
Constructor Detail |
public AbstractVitalMeasurement()
Method Detail |
protected void checkMeasurementType(java.lang.Object measurement)
public VitalSign register(java.lang.String vitalKey)
public abstract AbstractVitalMeasurement add(AbstractVitalMeasurement measurement)
public abstract AbstractVitalMeasurement divideBy(double divisor)
public java.util.Date getDateCaptured()
public java.lang.String getMeasurementUnit()
public void setMeasurementUnit(java.lang.String measurementUnit)
measurementUnit
- The measurementUnit to setpublic java.lang.String getMessage()
public void setMessage(java.lang.String message)
message
- The message to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |