Day Log

In order to provide the desired functionality, we need two main data structures:

  • A data structure for the current day, holding the date and the values and times for the day's measurements

  • A data structure storing all the days persistently

Thus, the day log data structure needs a field holding the date and a list of the time and value pairs. The date is stored in the integer variable date, holding the day of the month in the lowest byte, the month in the second-lowest byte, and the year in the two upper bytes. We are using this format instead of the Date or Calendar object for simplified comparison, required for keeping the log entries in the right order. To store the pairs, a local class Entry is used, consisting of two integer values: ...

Get Java™ 2 Micro Edition Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.