org.jlf.vitals
Class LongVitalMeasurement

java.lang.Object
  |
  +--org.jlf.vitals.AbstractVitalMeasurement
        |
        +--org.jlf.vitals.LongVitalMeasurement
All Implemented Interfaces:
java.lang.Comparable

public class LongVitalMeasurement
extends AbstractVitalMeasurement

LongVitalMeasurement is a class that holds a long data type measurement of a vital sign, such as number of milliseconds to execute a task or requests per second.


Field Summary
static java.lang.String LONG_MEASUREMENT_UNIT_DEFAULT
          Default measurement unit.
protected  long measurementValue
          Holds the long measurement variable.
 
Fields inherited from class org.jlf.vitals.AbstractVitalMeasurement
dateCaptured, measurementUnit, message
 
Constructor Summary
LongVitalMeasurement(long measurementValue)
          Creates a new measurement with given measurementValue.
 
Method Summary
 AbstractVitalMeasurement add(AbstractVitalMeasurement measurement)
          Adds one measurement of the same type to the current object.
 int compareTo(java.lang.Object measurement)
          Implementation of the Comparable interface.
 AbstractVitalMeasurement divideBy(double divisor)
          Divides the long measurement value by the input divisor, rounding the result before return.
 long getMeasurementValue()
          Returns the long measurementValue.
protected  void setMeasurementValue(long measurementValue)
          Sets the long measurementValue.
 java.lang.String toString()
          Print out a nice display string.
 
Methods inherited from class org.jlf.vitals.AbstractVitalMeasurement
checkMeasurementType, getDateCaptured, getMeasurementUnit, getMessage, register, setMeasurementUnit, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

measurementValue

protected long measurementValue
Holds the long measurement variable.


LONG_MEASUREMENT_UNIT_DEFAULT

public static final java.lang.String LONG_MEASUREMENT_UNIT_DEFAULT
Default measurement unit.

See Also:
Constant Field Values
Constructor Detail

LongVitalMeasurement

public LongVitalMeasurement(long measurementValue)
Creates a new measurement with given measurementValue.

Method Detail

add

public AbstractVitalMeasurement add(AbstractVitalMeasurement measurement)
Adds one measurement of the same type to the current object.

Specified by:
add in class AbstractVitalMeasurement
Returns:
A new measurement that adds the current measurement to the input measurement
See Also:
AbstractVitalMeasurement.add(AbstractVitalMeasurement)

divideBy

public AbstractVitalMeasurement divideBy(double divisor)
Divides the long measurement value by the input divisor, rounding the result before return.

Specified by:
divideBy in class AbstractVitalMeasurement
Returns:
A new measurement that adds the current measurement to the input measurement
See Also:
AbstractVitalMeasurement.divideBy(double)

getMeasurementValue

public long getMeasurementValue()
Returns the long measurementValue.


setMeasurementValue

protected void setMeasurementValue(long measurementValue)
Sets the long measurementValue.


compareTo

public int compareTo(java.lang.Object measurement)
Implementation of the Comparable interface.

See Also:
Comparable.compareTo(Object)

toString

public java.lang.String toString()
Print out a nice display string.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()