org.jSyncManager.API.Protocol.Util.StdApps

Class DateBookRecordEntry

Implemented Interfaces:
java.io.Serializable

public class DateBookRecordEntry
extends java.lang.Object
implements java.io.Serializable

A single entry record for a DateBookRecord.
See Also:
Serialized Form

Field Summary

static byte
ALARM_ADVANCE_DAYS
Alarm unit of Days (pre-appointment time decrement)
static byte
ALARM_ADVANCE_HOURS
Alarm unit of Hours (pre-appointment time decrement)
static byte
ALARM_ADVANCE_MINUTES
Alarm unit of Minutes (pre-appointment time decrement)
static byte
CLEAR_HAS_ALARM_INFO
A bitmap used to clear the "has alarm" flag.
static byte
CLEAR_HAS_DESCRIPTION
A bitmap used to clear the "has description" flag.
static byte
CLEAR_HAS_EXCEPTION_INFO
A bitmap used to clear the exception information flag.
static byte
CLEAR_HAS_NOTE
A bitmap used to clear the flag that this record has a note.
static byte
CLEAR_HAS_REPEAT_INFO
A bitmap used to clear the record repeat info.
static byte
CLEAR_WHEN_MODIFIED
A bitmap used to clear the date/time modification flag.
static char
DAY_MASK
A mask bitmap to mask the day in a PalmOS encoded date entry.
static int
DAY_ROTATE
A value for the amount to bit-rotate to query the day in a PalmOS-encoded date.
static byte
HAS_ALARM_INFO
A flag used to denote that this record has an alarm.
static byte
HAS_DESCRIPTION
A flag used to denote that this record hasa description.
static byte
HAS_EXCEPTION_INFO
A flag used to denote that this record has repeat exception info.
static byte
HAS_NOTE
A flag used to denote that this record contains a note.
static byte
HAS_REPEAT_INFO
A flag used to denote that this record contains repeating information.
static GregorianCalendar
MAXIMUM_DATE
The maximum date value the Palm can store.
static char
MONTH_MASK
A mask bitmap to mask the month in a PalmOS encoded date entry.
static int
MONTH_ROTATE
A value for the amount to bit-rotate to query the month in a PalmOS-encoded date.
static byte
NO_ALARM
Value used if there is no alarm.
static byte
NO_TIME
Value used if there is no time.
static byte
REPEAT_TYPE_DAILY
Repeat Type is Daily
static byte
REPEAT_TYPE_MONTHLY_BY_DAY_OF_MONTH
Repeat Type is Monthly by Date
static byte
REPEAT_TYPE_MONTHLY_BY_DAY_OF_WEEK
Repeat Type is Monthly by Day of Month
static byte
REPEAT_TYPE_NONE
No Repeat of appointment
static char
REPEAT_TYPE_NO_END_DATE
Repeat has no end date.
static byte
REPEAT_TYPE_WEEKLY
Repeat Type is Weekly
static byte
REPEAT_TYPE_YEARLY
Repeat Type is yearly (annual)
static byte
WHEN_MODIFIED
A flag used to denote that the date/time of this record has been modified.
static char
YEAR_MASK
A mask bitmap to mask the year in a PalmOS encoded date entry.
static int
YEAR_ROTATE
A value for the amount to bit-rotate to query the year in a PalmOS-encoded date.
protected static ResourceBundle
rb

Constructor Summary

DateBookRecordEntry()
DateBookRecordEntry defauit constructor.
DateBookRecordEntry(DateBookRecordEntry original)
Creates a new DateBookRecord entry that is a copy of the provided DateBookRecordEntry.

Method Summary

void
addExceptionEntry(Calendar date)
Add a new Exception entry from the date given.
void
addExceptionEntry(char date)
Add a new Exception entry from the date given.
DateBookRecordEntry
calculateNextEntry()
This method will figure out the next entry if this is a repeating entry.
static Calendar
convertDateTime(byte hourByte, byte minuteByte, char date)
Utility method to convert a byte set into the Calendar date/time.
byte
getAlarmAdvance()
Getter for property alarmAdvance.
Calendar
getAlarmTime()
Get alarm time of appointment.
byte
getAlarmUnitType()
Getter for property alarmUnitType.
byte
getApptFlags()
Getter for property apptFlags.
static byte[]
getDateBytesFromCalendar(Calendar c)
Parse the Calendar and convert to a byte array of date information.
Calendar
getEndTime()
Get end time of the appointment.
Calendar
getExceptionEntry(int i)
Get the index indicated exception entry.
int
getExceptionEntryCount()
Get the number of exception entries for this record.
Calendar
getRepeatEndDate()
Getter for property repeatEndDate.
byte
getRepeatFrequency()
Getter for property repeatFrequency.
byte
getRepeatOn()
Getter for property repeatOn.
byte
getRepeatStartOfWeek()
Getter for property repeatStartOfWeek.
byte
getRepeatType()
Getter for property repeatType.
Calendar
getStartTime()
Get start time of the appointment.
boolean
hasAlarm()
Check if alarm is set.
boolean
hasAlarmSet()
Getter for property alarmSet.
boolean
hasDescription()
Getter for property hasDescription.
boolean
hasExceptionList()
Getter for Exception List Flag.
boolean
hasFlag(byte flag)
Check whether a given flag is set.
boolean
hasNote()
Getter for property hasNote.
protected boolean
isExceptionEntry(Calendar date)
This method checks to see if the specified Calendar object is an exception.
boolean
isRepeating()
Getter for property repeating.
boolean
isWhenInfoChanged()
Getter for property whenInfoChanged.
void
setAlarmAdvance(byte alarmAdvance)
Setter for property alarmAdvance.
void
setAlarmSet(boolean alarmSet)
Setter for property alarmSet.
void
setAlarmTime(Calendar newValue)
Set alarm time for this appointment.
void
setAlarmUnitType(byte alarmUnitType)
Setter for property alarmUnitType.
void
setApptFlags(byte apptFlags)
Setter for property apptFlags.
void
setEndTime(Calendar newValue)
Set the end time for this appointment.
void
setExceptionList(boolean flag)
Setter for property alarmSet.
void
setHasDescription(boolean hasDescription)
Setter for property hasDescription.
void
setHasNote(boolean hasNote)
Setter for property hasNote.
void
setRepeatEndDate(Calendar repeatEndDate)
Setter for property repeatEndDate.
void
setRepeatFrequency(byte repeatFrequency)
Setter for property repeatFrequency.
void
setRepeatOn(byte repeatOn)
Setter for property repeatOn.
void
setRepeatStartOfWeek(byte repeatStartOfWeek)
Setter for property repeatStartOfWeek.
void
setRepeatType(byte repeatType)
Setter for property repeatType.
void
setRepeating(boolean repeating)
Setter for property repeating.
void
setStartTime(Calendar newValue)
Set the start time for appointment.
void
setWhenInfoChanged(boolean whenInfoChanged)
Setter for property whenInfoChanged.
String
toString()
Return a human-readable String representation of this record.

Field Details

ALARM_ADVANCE_DAYS

public static final byte ALARM_ADVANCE_DAYS
Alarm unit of Days (pre-appointment time decrement)
Field Value:
2

ALARM_ADVANCE_HOURS

public static final byte ALARM_ADVANCE_HOURS
Alarm unit of Hours (pre-appointment time decrement)
Field Value:
1

ALARM_ADVANCE_MINUTES

public static final byte ALARM_ADVANCE_MINUTES
Alarm unit of Minutes (pre-appointment time decrement)
Field Value:
0

CLEAR_HAS_ALARM_INFO

public static final byte CLEAR_HAS_ALARM_INFO
A bitmap used to clear the "has alarm" flag.
Field Value:
-65

CLEAR_HAS_DESCRIPTION

public static final byte CLEAR_HAS_DESCRIPTION
A bitmap used to clear the "has description" flag.
Field Value:
-5

CLEAR_HAS_EXCEPTION_INFO

public static final byte CLEAR_HAS_EXCEPTION_INFO
A bitmap used to clear the exception information flag.
Field Value:
-9

CLEAR_HAS_NOTE

public static final byte CLEAR_HAS_NOTE
A bitmap used to clear the flag that this record has a note.
Field Value:
-17

CLEAR_HAS_REPEAT_INFO

public static final byte CLEAR_HAS_REPEAT_INFO
A bitmap used to clear the record repeat info.
Field Value:
-33

CLEAR_WHEN_MODIFIED

public static final byte CLEAR_WHEN_MODIFIED
A bitmap used to clear the date/time modification flag.
Field Value:
127

DAY_MASK

public static final char DAY_MASK
A mask bitmap to mask the day in a PalmOS encoded date entry.
Field Value:
'\u001f'

DAY_ROTATE

public static final int DAY_ROTATE
A value for the amount to bit-rotate to query the day in a PalmOS-encoded date.
Field Value:
0

HAS_ALARM_INFO

public static final byte HAS_ALARM_INFO
A flag used to denote that this record has an alarm.
Field Value:
64

HAS_DESCRIPTION

public static final byte HAS_DESCRIPTION
A flag used to denote that this record hasa description.
Field Value:
4

HAS_EXCEPTION_INFO

public static final byte HAS_EXCEPTION_INFO
A flag used to denote that this record has repeat exception info. Exception info is used to denate that there are certain dates where a repeating record does not occur.
Field Value:
8

HAS_NOTE

public static final byte HAS_NOTE
A flag used to denote that this record contains a note.
Field Value:
16

HAS_REPEAT_INFO

public static final byte HAS_REPEAT_INFO
A flag used to denote that this record contains repeating information.
Field Value:
32

MAXIMUM_DATE

public static final GregorianCalendar MAXIMUM_DATE
The maximum date value the Palm can store. This entry is used for repeating entries that never end. We'll set this to January 1st, 2032 (one day past the maximum value).

MONTH_MASK

public static final char MONTH_MASK
A mask bitmap to mask the month in a PalmOS encoded date entry.
Field Value:
'\u01e0'

MONTH_ROTATE

public static final int MONTH_ROTATE
A value for the amount to bit-rotate to query the month in a PalmOS-encoded date.
Field Value:
5

NO_ALARM

public static final byte NO_ALARM
Value used if there is no alarm.
Field Value:
-1

NO_TIME

public static final byte NO_TIME
Value used if there is no time.
Field Value:
-1

REPEAT_TYPE_DAILY

public static final byte REPEAT_TYPE_DAILY
Repeat Type is Daily
Field Value:
1

REPEAT_TYPE_MONTHLY_BY_DAY_OF_MONTH

public static final byte REPEAT_TYPE_MONTHLY_BY_DAY_OF_MONTH
Repeat Type is Monthly by Date
Field Value:
4

REPEAT_TYPE_MONTHLY_BY_DAY_OF_WEEK

public static final byte REPEAT_TYPE_MONTHLY_BY_DAY_OF_WEEK
Repeat Type is Monthly by Day of Month
Field Value:
3

REPEAT_TYPE_NONE

public static final byte REPEAT_TYPE_NONE
No Repeat of appointment
Field Value:
0

REPEAT_TYPE_NO_END_DATE

public static final char REPEAT_TYPE_NO_END_DATE
Repeat has no end date.
Field Value:
'\uffff'

REPEAT_TYPE_WEEKLY

public static final byte REPEAT_TYPE_WEEKLY
Repeat Type is Weekly
Field Value:
2

REPEAT_TYPE_YEARLY

public static final byte REPEAT_TYPE_YEARLY
Repeat Type is yearly (annual)
Field Value:
5

WHEN_MODIFIED

public static final byte WHEN_MODIFIED
A flag used to denote that the date/time of this record has been modified.
Field Value:
-128

YEAR_MASK

public static final char YEAR_MASK
A mask bitmap to mask the year in a PalmOS encoded date entry.
Field Value:
'\ufe00'

YEAR_ROTATE

public static final int YEAR_ROTATE
A value for the amount to bit-rotate to query the year in a PalmOS-encoded date.
Field Value:
9

rb

protected static ResourceBundle rb

Constructor Details

DateBookRecordEntry

public DateBookRecordEntry()
DateBookRecordEntry defauit constructor.

DateBookRecordEntry

protected DateBookRecordEntry(DateBookRecordEntry original)
Creates a new DateBookRecord entry that is a copy of the provided DateBookRecordEntry.
Parameters:
original - DateBookRecordEntry original version.

Method Details

addExceptionEntry

public void addExceptionEntry(Calendar date)
Add a new Exception entry from the date given.
Parameters:
date - Calendar date of exception entry.

addExceptionEntry

public void addExceptionEntry(char date)
Add a new Exception entry from the date given.
Parameters:
date - char date value of exception entry.

calculateNextEntry

public DateBookRecordEntry calculateNextEntry()
This method will figure out the next entry if this is a repeating entry. If this is not a repeating entry, or if there are no further entries, this method will return null.
Returns:
a Calendar object containing the next entry.

convertDateTime

public static Calendar convertDateTime(byte hourByte,
                                       byte minuteByte,
                                       char date)
Utility method to convert a byte set into the Calendar date/time.
Parameters:
hourByte - byte Hour value.
minuteByte - byte Minute value.
date - char Date value.
Returns:
the Calendar object representing the specified date/time information.

getAlarmAdvance

public byte getAlarmAdvance()
Getter for property alarmAdvance.
Returns:
Value of property alarmAdvance.

getAlarmTime

public Calendar getAlarmTime()
Get alarm time of appointment.
Returns:
the alarm time of appointment, or null if there is no alarm.

getAlarmUnitType

public byte getAlarmUnitType()
Getter for property alarmUnitType.
Returns:
Value of property alarmUnitType.

getApptFlags

public byte getApptFlags()
Getter for property apptFlags.
Returns:
Value of property apptFlags.

getDateBytesFromCalendar

public static byte[] getDateBytesFromCalendar(Calendar c)
Parse the Calendar and convert to a byte array of date information.
Parameters:
c - Calendar value to convert.
Returns:
a byte array of the date value.

getEndTime

public Calendar getEndTime()
Get end time of the appointment.
Returns:
the end time of the appointment.

getExceptionEntry

public Calendar getExceptionEntry(int i)
Get the index indicated exception entry.
Parameters:
i - int index to the exception entry.
Returns:
the exception entry at the specified index.

getExceptionEntryCount

public int getExceptionEntryCount()
Get the number of exception entries for this record.
Returns:
The number of exception entries in this record.

getRepeatEndDate

public Calendar getRepeatEndDate()
Getter for property repeatEndDate.
Returns:
Value of property repeatEndDate.

getRepeatFrequency

public byte getRepeatFrequency()
Getter for property repeatFrequency.
Returns:
Value of property repeatFrequency.

getRepeatOn

public byte getRepeatOn()
Getter for property repeatOn.
Returns:
Value of property repeatOn.

getRepeatStartOfWeek

public byte getRepeatStartOfWeek()
Getter for property repeatStartOfWeek.
Returns:
Value of property repeatStartOfWeek.

getRepeatType

public byte getRepeatType()
Getter for property repeatType.
Returns:
Value of property repeatType.

getStartTime

public Calendar getStartTime()
Get start time of the appointment.
Returns:
the start time of the appointment.

hasAlarm

public boolean hasAlarm()
Check if alarm is set.
Returns:
true if the alarm is set, false otherwise.

hasAlarmSet

public boolean hasAlarmSet()
Getter for property alarmSet.
Returns:
Value of property alarmSet.

hasDescription

public boolean hasDescription()
Getter for property hasDescription.
Returns:
Value of property hasDescription.

hasExceptionList

public boolean hasExceptionList()
Getter for Exception List Flag.
Returns:
Value of property exceptionList.

hasFlag

public boolean hasFlag(byte flag)
Check whether a given flag is set.
Parameters:
flag - the flag to test.
Returns:
true if the flag is set, false otherwise.

hasNote

public boolean hasNote()
Getter for property hasNote.
Returns:
Value of property hasNote.

isExceptionEntry

protected boolean isExceptionEntry(Calendar date)
This method checks to see if the specified Calendar object is an exception.
Parameters:
date - the Calendar object to test.
Returns:
true if this entry is in the exception list, false otherwise.

isRepeating

public boolean isRepeating()
Getter for property repeating.
Returns:
Value of property repeating.

isWhenInfoChanged

public boolean isWhenInfoChanged()
Getter for property whenInfoChanged.
Returns:
Value of property whenInfoChanged.

setAlarmAdvance

public void setAlarmAdvance(byte alarmAdvance)
Setter for property alarmAdvance.
Parameters:
alarmAdvance - New value of property alarmAdvance.

setAlarmSet

public void setAlarmSet(boolean alarmSet)
Setter for property alarmSet.
Parameters:
alarmSet - New value of property alarmSet.

setAlarmTime

public void setAlarmTime(Calendar newValue)
Set alarm time for this appointment.
Parameters:
newValue - the time for this appointment.

setAlarmUnitType

public void setAlarmUnitType(byte alarmUnitType)
Setter for property alarmUnitType.
Parameters:
alarmUnitType - New value of property alarmUnitType.

setApptFlags

public void setApptFlags(byte apptFlags)
Setter for property apptFlags.
Parameters:
apptFlags - New value of property apptFlags.

setEndTime

public void setEndTime(Calendar newValue)
Set the end time for this appointment.
Parameters:
newValue - the end time for this appointment.

setExceptionList

public void setExceptionList(boolean flag)
Setter for property alarmSet.
Parameters:
flag - New value of property alarmSet.

setHasDescription

public void setHasDescription(boolean hasDescription)
Setter for property hasDescription.
Parameters:
hasDescription - New value of property hasDescription.

setHasNote

public void setHasNote(boolean hasNote)
Setter for property hasNote.
Parameters:
hasNote - New value of property hasNote.

setRepeatEndDate

public void setRepeatEndDate(Calendar repeatEndDate)
Setter for property repeatEndDate.
Parameters:
repeatEndDate - New value of property repeatEndDate.

setRepeatFrequency

public void setRepeatFrequency(byte repeatFrequency)
Setter for property repeatFrequency.
Parameters:
repeatFrequency - New value of property repeatFrequency.

setRepeatOn

public void setRepeatOn(byte repeatOn)
Setter for property repeatOn.
Parameters:
repeatOn - New value of property repeatOn.

setRepeatStartOfWeek

public void setRepeatStartOfWeek(byte repeatStartOfWeek)
Setter for property repeatStartOfWeek.
Parameters:
repeatStartOfWeek - New value of property repeatStartOfWeek.

setRepeatType

public void setRepeatType(byte repeatType)
Setter for property repeatType.
Parameters:
repeatType - New value of property repeatType.

setRepeating

public void setRepeating(boolean repeating)
Setter for property repeating.
Parameters:
repeating - New value of property repeating.

setStartTime

public void setStartTime(Calendar newValue)
Set the start time for appointment.
Parameters:
newValue - the start time for appointment.

setWhenInfoChanged

public void setWhenInfoChanged(boolean whenInfoChanged)
Setter for property whenInfoChanged.
Parameters:
whenInfoChanged - New value of property whenInfoChanged.

toString

public String toString()
Return a human-readable String representation of this record.
Returns:
A human-readable String representation of this record.