com.biocomfort.TO.data
Class DataTO

java.lang.Object
  extended by com.biocomfort.TO.data.DataTO
All Implemented Interfaces:
TO
Direct Known Subclasses:
BloodGlucoseTO, BloodPressureTO, WeightTO

public abstract class DataTO
extends java.lang.Object
implements TO

Represents a basic data class for measurement data that are received from medical devices.

Each time a measurement of a medical device is received by the SDK an onDataReceived event of the SDKDataListener is fired. The parameter data of this event method transfers an instance of a concrete implementation of this class. The concrete implementation instance that is transfered depends on the type of medical device that sends the measurement.

See Also:
SDKDataListener.onDataReceived(com.biocomfort.TO.MedicalDeviceTO, TO)

Constructor Summary
DataTO()
          Constructs a DataTO object with initializing it so that the user number is 1 and its date and time of the measurement represents the time at which it was allocated, measured to the nearest millisecond.
 
Method Summary
 java.util.Date getDateTime()
          Returns the data object's date and time of the representing measurement.
 int getDay()
          Returns the day of the month of the measurement's date.
 int getHourOfDay()
          Returns the hour of day of the measurement's time.
 int getMinute()
          Returns the number of minutes past the hour of the measurement's time, as interpreted in the local time zone.
 int getMonth()
          Returns a number representing the month of the measurement's date that contains or begins with the instant in time of this measurement's date, as interpreted for the default time zone and local.
 int getSecond()
          Returns the number of seconds past the minute of the measurement's time.
 int getUser()
          Returns the user number of the measurement data represented by this DataTO object.
 int getYear()
          Returns a number representing the year of the measurement's date that contains or begins with the instant in time of the measurement's date, as interpreted for the default time zone and local.
 boolean isTransmittedDataSet()
          Returns true if the measurement data represented by this DataTO object was transmitted.
 void setDateTime(java.util.Date dateTime)
          Set the data object's date and time of the representing measurement.
 void setDateTime(int year, int month, int day, int hourOfDay, int minute, int second)
          Sets the date and time for the measurement's date represented by this DataTO object so that it represents the instant at the start of the minute specified by the year, month, day, hourOfDay, minute, and second arguments, for the default time zone and local.
 void setTransmittedDataSet(boolean transmittedDataSet)
          Sets the transmitted state for the measurement data represented by this DataTO object.
 void setUser(int user)
          Sets the user number of the measurement data represented by this DataTO object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTO

public DataTO()
Constructs a DataTO object with initializing it so that the user number is 1 and its date and time of the measurement represents the time at which it was allocated, measured to the nearest millisecond.

Method Detail

getDateTime

public java.util.Date getDateTime()
Returns the data object's date and time of the representing measurement.

Returns:
the measurement's date and time

setDateTime

public void setDateTime(java.util.Date dateTime)
Set the data object's date and time of the representing measurement.

Parameters:
dateTime - the new measurement's date and time

isTransmittedDataSet

public boolean isTransmittedDataSet()
Returns true if the measurement data represented by this DataTO object was transmitted.

This value represents a marking bit of received measurement data: The TRX bit is used to mark transmitted (TRX = 0) and untransmitted (TRX = 1) data sets.

Returns:
true if this data were transmitted

setTransmittedDataSet

public void setTransmittedDataSet(boolean transmittedDataSet)
Sets the transmitted state for the measurement data represented by this DataTO object.

This state represents a marking bit of received measurement data: The TRX bit is used to mark transmitted (TRX = 0) and untransmitted (TRX = 1) data sets.

Parameters:
transmittedDataSet - true if this data were transmitted, false otherwise

getUser

public int getUser()
Returns the user number of the measurement data represented by this DataTO object.

Returns:
the measurement's user number

setUser

public void setUser(int user)
Sets the user number of the measurement data represented by this DataTO object.

Parameters:
user - the new measurement's user number

setDateTime

public void setDateTime(int year,
                        int month,
                        int day,
                        int hourOfDay,
                        int minute,
                        int second)
Sets the date and time for the measurement's date represented by this DataTO object so that it represents the instant at the start of the minute specified by the year, month, day, hourOfDay, minute, and second arguments, for the default time zone and local.

Parameters:
year - the year
month - the month between 1-12
day - the day of month between 1-31
hourOfDay - the hour of a day between 0-23
minute - the minutes between 0-59
second - the seconds between 0-59

getYear

public int getYear()
Returns a number representing the year of the measurement's date that contains or begins with the instant in time of the measurement's date, as interpreted for the default time zone and local.

Returns:
the year of this measurement's date

getMonth

public int getMonth()
Returns a number representing the month of the measurement's date that contains or begins with the instant in time of this measurement's date, as interpreted for the default time zone and local. The value returned is between 1 and 12, with the value 1 representing January.

Returns:
the month of this measurement's date between 1-12

getDay

public int getDay()
Returns the day of the month of the measurement's date. The value returned is between 1 and 31 representing the day of the month that contains or begins with the instant in time of the measurement date, as interpreted in the local time.

Returns:
the day of month of this measurement's date between 1-31

getHourOfDay

public int getHourOfDay()
Returns the hour of day of the measurement's time. The returned value is a number (0 through 23) representing the hour within the day that contains or begins with the instant in time of the measurement's time, as interpreted in the local time zone.

Returns:
the hour of day of this measurement's time between 0-23

getMinute

public int getMinute()
Returns the number of minutes past the hour of the measurement's time, as interpreted in the local time zone. The value returned is between 0 and 59.

Returns:
the minutes of this measurement's time between 0-59

getSecond

public int getSecond()
Returns the number of seconds past the minute of the measurement's time. The value returned is between 0 and 59.

Returns:
the seconds of this measurement's time between 0-59