com.myzeo.decoder
Class ZeoData

java.lang.Object
  extended by com.myzeo.decoder.ZeoData
All Implemented Interfaces:
java.lang.Comparable<ZeoData>

public class ZeoData
extends java.lang.Object
implements java.lang.Comparable<ZeoData>

Core functionality for decoding a Zeo data record. This class decodes the saved data records from firmware 2.6.3O only. It cannot decode earlier versions.


Field Summary
static int DAYS_PER_MONTH
          Generic Zeo defines that correspond to Zeo's time definition, hypnogram lengths and the like.
static int DAYS_PER_MONTH_MAX
           
static int DAYS_PER_WEEK
           
static int EPOCHS_PER_HOUR
           
static int EPOCHS_PER_MINUTE
           
static int HEADER_SIZE
           
static int HOURS_PER_DAY
           
static int HYP_BASE_LENGTH
           
static int HYP_BASE_PER_DISPLAY
           
static int HYP_BASE_STEP
           
static int HYP_DISPLAY_LENGTH
           
static int HYP_DISPLAY_STEP
           
static int HYP_SECONDS_MAX
           
static byte[] IDENTIFIER
          All sleep data records must start with the following identifier string.
static int IDENTIFIER_SIZE
          A two byte format version value follows the identifier.
 boolean is_nap
          variables
static int MAX_RECORD_BYTES
          Maximum number of bytes there can be in a record.
static int MINUTES_PER_HOUR
           
static int MONTHS_PER_YEAR
           
static int MSEC_PER_SECOND
           
static int SECONDS_PER_DAY
           
static int SECONDS_PER_EPOCH
           
static int SECONDS_PER_HOUR
           
static int SECONDS_PER_MINUTE
           
static int SECONDS_PER_MONTH
           
static int SECONDS_PER_WEEK
           
static byte[] V22
          The version value is enumerated here.
static int V22_SIZE
          The record version size.
static int VERSION_SIZE
           
 
Constructor Summary
ZeoData(java.nio.ByteBuffer in, int version)
          Construct a Zeo data record given the input stream and data format version identification.
 
Method Summary
 int compareLength(ZeoData other)
          Compares two records and indicates whether or not the given record is "larger" or "smaller" than some other record.
 int compareTo(ZeoData other)
          Implementation of comparable for sorting records based on sleep start times.
 java.util.Calendar compute_alarm_set_time()
          Compute the set alarm time that was in use for the night of sleep represented by this record.
 java.util.Calendar compute_rise_time()
          Return the rise time as a Calendar object.
 boolean get_airplane_mode()
          Returns airplane mode flag.
 java.util.Calendar get_airplane_off()
          Returns the last time airplane mode was disengaged, or null if it has not been disengaged.
 java.util.Calendar get_airplane_on()
          Returns the last time airplane mode was engaged, or null if it has not been engaged.
 TimeChange[] get_alarm_change()
          Returns the list of alarm changes, as an array of TimeChange objects.
 java.util.Calendar get_alarm_off()
          Returns the time the alarm was turned off, or null if it was not turned off.
 AlarmReason get_alarm_reason()
          Returns reason alarm was triggered.
 java.util.Calendar[] get_alarm_ring()
          Returns a list of the first and last (if more than one) times the alarm rang.
 java.util.Calendar get_alarm_set_time()
          Returns the time the alarm was set for.
 java.util.Calendar[] get_alarm_snooze()
          Returns a list of the times the snooze button was pressed
 char[] get_assert_function_name()
          Returns the name of the function where assert occurred, if an assert occurred and triggered a watchdog reset.
 int get_assert_line_number()
          Returns the line number on which an assert occurred, if an assert occurred and triggered a watchdog reset.
 int get_awakenings_average()
          Returns the average number of awakenings from sleep history.
 int get_awakenings()
          Returns the number of awakenings for the current record.
 byte get_backlight()
          Returns the backlight brightness setting.
 int get_base_hypnogram_count()
          Returns the base_hypnogram_count value for the record.
 byte[] get_base_hypnogram()
          Returns the base hypnogram as an array of integers.
 ClockMode get_clock_mode()
          Returns the 12/24 hour clock selection.
 long get_crc()
          Returns the CRC16 value that was in the record.
 java.util.Calendar get_current_time()
          Returns the time that the record was output.
 int get_display_hypnogram_count()
          Returns the display_hypnogram_count value for the record.
 int get_display_hypnogram_forced_index()
          Returns the index of the display hypnogram bin that was forced to a specific stage, or 0 if there is no such bin.
 int get_display_hypnogram_forced_stage()
          Returns the index of the display hypnogram bin that was forced to a specific stage.
 byte[] get_display_hypnogram()
          Returns the display hypnogram as an array of integers.
 java.util.Calendar get_end_of_night()
          Returns the Zeo record's end of night which can be used for comparison purposes.
 java.util.Calendar get_factory_reset()
          Returns the last time a factory reset was performed, or null if it has not been performed.
 int get_format_version()
          Returns the version of the sleep record data format.
 long get_headband_id()
          Returns the serial number of the most recently docked headband.
 short[] get_headband_impedance()
          Returns an array of headband impedance values collected over the past 24 hours.
 short[] get_headband_packets()
          Returns an array of headband packet loss values collected over the past 24 hours.
 byte[] get_headband_rssi()
          Returns an array of headband received signal strength values collected over the past 24 hours.
 short[] get_headband_status()
          Returns an array of headband docking status values collected over the past 24 hours.
 java.util.Calendar get_hypnogram_start_time()
          Returns the hypnogram start time.
 int get_id_hw()
          Returns the Zeo hardware version.
 int get_id_sw()
          Returns the Zeo software version.
 java.util.Calendar get_rise_time()
          Returns the time the user got up.
 TimeChange[] get_rtc_change()
          Returns the list of real-time clock changes, as an array of TimeChange objects.
 java.util.Calendar get_sensor_life_reset()
          Returns the last time the sensor life counter was reset, or null if it has not been reset.
 java.util.Calendar get_sleep_date()
          Returns the sleep_date for the current record.
 int get_sleep_rating()
          Returns the sleep rating for the current record.
 java.util.Calendar get_sleep_stat_reset()
          Returns the last time the sleep history was reset, or null if it has not been reset.
 boolean get_sleep_valid()
          Returns the sleep valid flag.
 int get_snooze_time()
          Returns the snooze time setting in minutes.
 java.util.Calendar get_start_of_night()
          Returns the Zeo record's start of night which can be used for comparison purposes.
 int get_time_in_deep_average()
          Returns the average time in deep from sleep history.
 int get_time_in_deep_best()
          Returns the best time in deep from sleep history.
 int get_time_in_deep()
          Returns the time in deep for the current record.
 int get_time_in_light_average()
          Returns the average time in light from sleep history.
 int get_time_in_light()
          Returns the time in light for the current record.
 int get_time_in_rem_average()
          Returns the average time in rem from sleep history.
 int get_time_in_rem_best()
          Returns the best time in rem from sleep history.
 int get_time_in_rem()
          Returns the time in rem for the current record.
 int get_time_in_wake_average()
          Returns the average time in wake from sleep history.
 int get_time_in_wake()
          Returns the time in wake for the current record.
 int get_time_to_z_average()
          Returns the average time to sleep from sleep history.
 int get_time_to_z()
          Returns the time to sleep for the current record.
 int get_total_z_average()
          Returns the average total sleep time from sleep history.
 int get_total_z_best()
          Returns the best total sleep time from sleep history.
 int get_total_z()
          Returns the total sleep time for the current record.
 WakeTone get_wake_tone()
          Returns the selected wake tone.
 int get_wake_window()
          Returns the selected wake window in minutes.
 boolean get_wdt_reset()
          Returns whether a watchdog reset occurred.
 WriteReason get_write_reason()
          Returns the reason this record was written to the card.
 boolean get_zeo_wake_on()
          Returns whether SmartWake was enabled.
 int get_zq_score_average()
          Returns the average ZQ score from sleep history.
 int get_zq_score_best()
          Returns the best ZQ score from sleep history.
 int get_zq_score()
          Returns the ZQ score for the current record.
 boolean is_reset_record()
           
 boolean is_sleep_rating_record()
          Tests if this record's write reason is FS_REASON_SLEEP_RATED.
 boolean same_night(ZeoData other_record)
          Indicates whether or not the other_record is from the same "night" as this record.
 boolean same_start_time(ZeoData other_record)
          Indicates whether other_record has the same start time as this record.
 void set_sleep_date()
          Set the sleep_date for the current record.
 java.lang.String toHuman()
          Generate a human readable representation of the Zeo record.
 java.lang.String toXML()
          Generate a XML representation of the Zeo record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final byte[] IDENTIFIER
All sleep data records must start with the following identifier string.


IDENTIFIER_SIZE

public static final int IDENTIFIER_SIZE
A two byte format version value follows the identifier.

See Also:
Constant Field Values

VERSION_SIZE

public static final int VERSION_SIZE
See Also:
Constant Field Values

HEADER_SIZE

public static final int HEADER_SIZE
See Also:
Constant Field Values

V22

public static final byte[] V22
The version value is enumerated here. The value is a little endian number.


V22_SIZE

public static final int V22_SIZE
The record version size.

See Also:
Constant Field Values

MAX_RECORD_BYTES

public static final int MAX_RECORD_BYTES
Maximum number of bytes there can be in a record. This value should be larger than the size of all past sleep record versions. This value is used to limit how far we search for another record.

See Also:
Constant Field Values

DAYS_PER_MONTH

public static final int DAYS_PER_MONTH
Generic Zeo defines that correspond to Zeo's time definition, hypnogram lengths and the like. Please note that the ordering of these definitions is forced due to Java's insistence on not having static variables forward referencing other static variables.

See Also:
Constant Field Values

DAYS_PER_MONTH_MAX

public static final int DAYS_PER_MONTH_MAX
See Also:
Constant Field Values

DAYS_PER_WEEK

public static final int DAYS_PER_WEEK
See Also:
Constant Field Values

HOURS_PER_DAY

public static final int HOURS_PER_DAY
See Also:
Constant Field Values

MINUTES_PER_HOUR

public static final int MINUTES_PER_HOUR
See Also:
Constant Field Values

MONTHS_PER_YEAR

public static final int MONTHS_PER_YEAR
See Also:
Constant Field Values

MSEC_PER_SECOND

public static final int MSEC_PER_SECOND
See Also:
Constant Field Values

SECONDS_PER_EPOCH

public static final int SECONDS_PER_EPOCH
See Also:
Constant Field Values

SECONDS_PER_MINUTE

public static final int SECONDS_PER_MINUTE
See Also:
Constant Field Values

SECONDS_PER_HOUR

public static final int SECONDS_PER_HOUR
See Also:
Constant Field Values

SECONDS_PER_DAY

public static final int SECONDS_PER_DAY
See Also:
Constant Field Values

SECONDS_PER_MONTH

public static final int SECONDS_PER_MONTH
See Also:
Constant Field Values

SECONDS_PER_WEEK

public static final int SECONDS_PER_WEEK
See Also:
Constant Field Values

EPOCHS_PER_MINUTE

public static final int EPOCHS_PER_MINUTE
See Also:
Constant Field Values

EPOCHS_PER_HOUR

public static final int EPOCHS_PER_HOUR
See Also:
Constant Field Values

HYP_BASE_STEP

public static final int HYP_BASE_STEP
See Also:
Constant Field Values

HYP_DISPLAY_STEP

public static final int HYP_DISPLAY_STEP
See Also:
Constant Field Values

HYP_SECONDS_MAX

public static final int HYP_SECONDS_MAX
See Also:
Constant Field Values

HYP_BASE_LENGTH

public static final int HYP_BASE_LENGTH
See Also:
Constant Field Values

HYP_BASE_PER_DISPLAY

public static final int HYP_BASE_PER_DISPLAY
See Also:
Constant Field Values

HYP_DISPLAY_LENGTH

public static final int HYP_DISPLAY_LENGTH
See Also:
Constant Field Values

is_nap

public boolean is_nap
variables

Constructor Detail

ZeoData

public ZeoData(java.nio.ByteBuffer in,
               int version)
Construct a Zeo data record given the input stream and data format version identification.

Parameters:
in - The data input stream that will be read to construct the record.
version - The version number of the record to decode.
Method Detail

compareTo

public int compareTo(ZeoData other)
Implementation of comparable for sorting records based on sleep start times. It returns whether or not this record is "smaller", "equal to", or "larger" than the other record. This determination is based on the start_of_night values. Records with null start_of_night are considered smaller than all others. If both records have null start times they are considered equal. Please note that "compareTo == 0" and equals are not one and the same when examining ZeoRecords. The "compareTo == 0" in this context means that both records have the same start time.

Specified by:
compareTo in interface java.lang.Comparable<ZeoData>
Parameters:
other - The ZeoData record to compare to this record
Returns:
-1 if this record is smaller than the other record, 0 if the records have equal start times, 1 if this record is larger than the other record.

compareLength

public int compareLength(ZeoData other)
Compares two records and indicates whether or not the given record is "larger" or "smaller" than some other record. This comparison is made based on the "length of sleep" the record represents. The length is primarily the time between the start and end of the night. If this night has a shorter length it's smaller. If it has a longer length it's larger. If both nights have the same length based on start and end times then the hypnogram count values are examined. In this case, if this night has a smaller count than the other night it's smaller. If it has a larger count it's larger. Only when both the night elapsed time and hypnogram counts are the same are the nights "equal". Please note that "compareLength == 0" and equals are not at all the same when examining ZeoRecords. The "compareLength == 0" in this context means that both records represent the same length of time. However, they may not even represent the same sleep episode. If the condition exists that one or the other start or end of night values is undefined then whatever night has an undefined values is deemed shorter than the other. If both records have undefined values then we assume the records are equal.

Parameters:
other - The ZeoData record to compare to this record.
Returns:
-1 if this record has shorter sleep time than the other record, 0 if this records have equal length sleep time (or undefined), 1 if this record has longer sleep time than the other record.

compute_alarm_set_time

public java.util.Calendar compute_alarm_set_time()
Compute the set alarm time that was in use for the night of sleep represented by this record. If the alarm was turned on, the set alarm time as a full date and time is returned. if the alarm was turned off, null is returned. If the alarm rang, the most recent alarm change preceding the alarm ring is used. If the alarm did not ring, the most recent alarm change preceding the end of night is used. If no alarm change matching the criteria can be found (due to later alarm changes overwriting the alarm change we want), null is returned. Note that null can be returned even if the alarm did ring.

Returns:
a calendar object representing the set alarm time and date, or null.

compute_rise_time

public java.util.Calendar compute_rise_time()
Return the rise time as a Calendar object. The rise time indicates when the user got up and is computed as "the time of day at the end of the last 5 minute block of sleep in the display hypnogram." If no sleep is present in the hypnogram, the result is null.

Returns:
a calendar object representing the rise time.

get_airplane_mode

public boolean get_airplane_mode()
Returns airplane mode flag.

Returns:
the airplane mode flag

get_airplane_off

public java.util.Calendar get_airplane_off()
Returns the last time airplane mode was disengaged, or null if it has not been disengaged.

Returns:
the last time airplane mode was disengaged

get_airplane_on

public java.util.Calendar get_airplane_on()
Returns the last time airplane mode was engaged, or null if it has not been engaged.

Returns:
the last time airplane mode was engaged

get_alarm_change

public TimeChange[] get_alarm_change()
Returns the list of alarm changes, as an array of TimeChange objects.

Returns:
the list of alarm changes

get_alarm_off

public java.util.Calendar get_alarm_off()
Returns the time the alarm was turned off, or null if it was not turned off.

Returns:
the time the alarm was turned off

get_alarm_reason

public AlarmReason get_alarm_reason()
Returns reason alarm was triggered.

Returns:
the reason alarm was triggered

get_alarm_ring

public java.util.Calendar[] get_alarm_ring()
Returns a list of the first and last (if more than one) times the alarm rang.

Returns:
the times the alarm rang

get_alarm_set_time

public java.util.Calendar get_alarm_set_time()
Returns the time the alarm was set for.

Returns:
the time the alarm was set for

get_alarm_snooze

public java.util.Calendar[] get_alarm_snooze()
Returns a list of the times the snooze button was pressed

Returns:
the times the snooze button was pressed

get_assert_function_name

public char[] get_assert_function_name()
Returns the name of the function where assert occurred, if an assert occurred and triggered a watchdog reset.

Returns:
the name of the function where assert occurred

get_assert_line_number

public int get_assert_line_number()
Returns the line number on which an assert occurred, if an assert occurred and triggered a watchdog reset.

Returns:
the line number on which an assert occurred

get_awakenings

public int get_awakenings()
Returns the number of awakenings for the current record.

Returns:
the number of awakenings for the current record

get_awakenings_average

public int get_awakenings_average()
Returns the average number of awakenings from sleep history.

Returns:
the average number of awakenings from sleep history.

get_backlight

public byte get_backlight()
Returns the backlight brightness setting.

Returns:
the backlight brightness setting

get_base_hypnogram

public byte[] get_base_hypnogram()
Returns the base hypnogram as an array of integers.

Returns:
the base hypnogram

get_base_hypnogram_count

public int get_base_hypnogram_count()
Returns the base_hypnogram_count value for the record.

Returns:
the count value.

get_clock_mode

public ClockMode get_clock_mode()
Returns the 12/24 hour clock selection.

Returns:
the 12/24 hour clock selection

get_crc

public long get_crc()
Returns the CRC16 value that was in the record.

Returns:
the crc value read from the most recent record.

get_current_time

public java.util.Calendar get_current_time()
Returns the time that the record was output.

Returns:
a calendar value that is the time the record was output.

get_display_hypnogram

public byte[] get_display_hypnogram()
Returns the display hypnogram as an array of integers.

Returns:
the display hypnogram

get_display_hypnogram_count

public int get_display_hypnogram_count()
Returns the display_hypnogram_count value for the record.

Returns:
the count value.

get_display_hypnogram_forced_index

public int get_display_hypnogram_forced_index()
Returns the index of the display hypnogram bin that was forced to a specific stage, or 0 if there is no such bin.

Returns:
the index of the forced display hypnogram bin

get_display_hypnogram_forced_stage

public int get_display_hypnogram_forced_stage()
Returns the index of the display hypnogram bin that was forced to a specific stage.

Returns:
the stage of the forced display hypnogram bin

get_end_of_night

public java.util.Calendar get_end_of_night()
Returns the Zeo record's end of night which can be used for comparison purposes.

Returns:
a calendar value that is the end of the record's night.

get_factory_reset

public java.util.Calendar get_factory_reset()
Returns the last time a factory reset was performed, or null if it has not been performed.

Returns:
the last time a factory reset was performed

get_format_version

public int get_format_version()
Returns the version of the sleep record data format.

Returns:
the version of the sleep record data format

get_headband_id

public long get_headband_id()
Returns the serial number of the most recently docked headband.

Returns:
the serial number of the most recently docked headband

get_headband_impedance

public short[] get_headband_impedance()
Returns an array of headband impedance values collected over the past 24 hours.

Returns:
an array of headband impedance values

get_headband_packets

public short[] get_headband_packets()
Returns an array of headband packet loss values collected over the past 24 hours.

Returns:
an array of headband packet loss values

get_headband_rssi

public byte[] get_headband_rssi()
Returns an array of headband received signal strength values collected over the past 24 hours.

Returns:
an array of headband received signal strength values

get_headband_status

public short[] get_headband_status()
Returns an array of headband docking status values collected over the past 24 hours.

Returns:
an array of headband docking status values

get_hypnogram_start_time

public java.util.Calendar get_hypnogram_start_time()
Returns the hypnogram start time.

Returns:
the hypnogram start time

get_id_hw

public int get_id_hw()
Returns the Zeo hardware version.

Returns:
the Zeo hardware version

get_id_sw

public int get_id_sw()
Returns the Zeo software version.

Returns:
the Zeo software version

get_rise_time

public java.util.Calendar get_rise_time()
Returns the time the user got up.

Returns:
the time the user got up

get_rtc_change

public TimeChange[] get_rtc_change()
Returns the list of real-time clock changes, as an array of TimeChange objects.

Returns:
the list of real-time clock changes

get_sensor_life_reset

public java.util.Calendar get_sensor_life_reset()
Returns the last time the sensor life counter was reset, or null if it has not been reset.

Returns:
the last time the sensor life counter was reset

get_sleep_date

public java.util.Calendar get_sleep_date()
Returns the sleep_date for the current record.

Returns:
a calendar value indicating the sleep_date (see set_sleep_date).

get_sleep_rating

public int get_sleep_rating()
Returns the sleep rating for the current record.

Returns:
the sleep rating for the current record

get_sleep_stat_reset

public java.util.Calendar get_sleep_stat_reset()
Returns the last time the sleep history was reset, or null if it has not been reset.

Returns:
the last time the sleep history was reset

get_sleep_valid

public boolean get_sleep_valid()
Returns the sleep valid flag.

Returns:
the sleep valid flag

get_snooze_time

public int get_snooze_time()
Returns the snooze time setting in minutes.

Returns:
the snooze time setting in minutes

get_start_of_night

public java.util.Calendar get_start_of_night()
Returns the Zeo record's start of night which can be used for comparison purposes.

Returns:
a calendar value that is the start of the record's night.

get_time_in_deep

public int get_time_in_deep()
Returns the time in deep for the current record.

Returns:
the time in deep for the current record

get_time_in_deep_average

public int get_time_in_deep_average()
Returns the average time in deep from sleep history.

Returns:
the average time in deep

get_time_in_deep_best

public int get_time_in_deep_best()
Returns the best time in deep from sleep history.

Returns:
the best time in deep

get_time_in_light

public int get_time_in_light()
Returns the time in light for the current record.

Returns:
the time in light for the current record

get_time_in_light_average

public int get_time_in_light_average()
Returns the average time in light from sleep history.

Returns:
the average time in light

get_time_in_rem

public int get_time_in_rem()
Returns the time in rem for the current record.

Returns:
the time in rem for the current record

get_time_in_rem_average

public int get_time_in_rem_average()
Returns the average time in rem from sleep history.

Returns:
the average time in rem

get_time_in_rem_best

public int get_time_in_rem_best()
Returns the best time in rem from sleep history.

Returns:
the best time in rem

get_time_in_wake

public int get_time_in_wake()
Returns the time in wake for the current record.

Returns:
the time in wake for the current record

get_time_in_wake_average

public int get_time_in_wake_average()
Returns the average time in wake from sleep history.

Returns:
the average time in wake

get_time_to_z

public int get_time_to_z()
Returns the time to sleep for the current record.

Returns:
the time to sleep for the current record

get_time_to_z_average

public int get_time_to_z_average()
Returns the average time to sleep from sleep history.

Returns:
the average time to sleep

get_total_z

public int get_total_z()
Returns the total sleep time for the current record.

Returns:
the total sleep time for the current record

get_total_z_average

public int get_total_z_average()
Returns the average total sleep time from sleep history.

Returns:
the average total sleep time

get_total_z_best

public int get_total_z_best()
Returns the best total sleep time from sleep history.

Returns:
the best total sleep time

get_wake_tone

public WakeTone get_wake_tone()
Returns the selected wake tone.

Returns:
the selected wake tone

get_wake_window

public int get_wake_window()
Returns the selected wake window in minutes.

Returns:
the selected wake window in minutes

get_wdt_reset

public boolean get_wdt_reset()
Returns whether a watchdog reset occurred.

Returns:
whether a watchdog reset occurred

get_write_reason

public WriteReason get_write_reason()
Returns the reason this record was written to the card.

Returns:
the reason this record was written to the card

get_zeo_wake_on

public boolean get_zeo_wake_on()
Returns whether SmartWake was enabled.

Returns:
whether SmartWake was enabled

get_zq_score

public int get_zq_score()
Returns the ZQ score for the current record.

Returns:
the ZQ score for the current record

get_zq_score_average

public int get_zq_score_average()
Returns the average ZQ score from sleep history.

Returns:
the average ZQ score

get_zq_score_best

public int get_zq_score_best()
Returns the best ZQ score from sleep history.

Returns:
the best ZQ score

is_reset_record

public boolean is_reset_record()

is_sleep_rating_record

public boolean is_sleep_rating_record()
Tests if this record's write reason is FS_REASON_SLEEP_RATED.

Returns:
true if write_reason equals FS_REASON_SLEEP_RATED.

same_night

public boolean same_night(ZeoData other_record)
Indicates whether or not the other_record is from the same "night" as this record. This is accomplished by examining the two nights sleep_date values to see if they are the same. The assumption is that the sleep_date values for the record have been set.

Returns:
true if this night and the other_record night have the same sleep_date (ie. are from the same day of sleep).

same_start_time

public boolean same_start_time(ZeoData other_record)
Indicates whether other_record has the same start time as this record.

Returns:
true if this night and other_record night have same start time.

set_sleep_date

public void set_sleep_date()
Set the sleep_date for the current record. This determines the "day of sleep" for the record. Days of sleep start at 6am and run till the following day at 6am. Subtracting 6 hours off the start of night value, converting that to a calendar value and then forcing the time to 6am completes the conversion.


toHuman

public java.lang.String toHuman()
Generate a human readable representation of the Zeo record.

Returns:
a string that contains a record in a human readable key-value pair form.

toXML

public java.lang.String toXML()
Generate a XML representation of the Zeo record.

Returns:
a string that contains the XML representation of the Zeo record.

Copyright © 2010, Zeo, Inc. All rights reserved.