jSyncManager

org.jSyncManager.API.Protocol.Util.StdApps
Class DateBookRecordEntry

java.lang.Object
  |
  +--org.jSyncManager.API.Protocol.Util.StdApps.DateBookRecordEntry
All Implemented Interfaces:
java.io.Serializable

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

A single entry record for a DateBookRecord.

Version:
$Revision: 1.19 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: yaztromo $ on $Date: 2003/05/13 19:29:46 $.
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 java.util.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.
protected static java.util.ResourceBundle rb
           
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 char REPEAT_TYPE_NO_END_DATE
          Repeat has no end date.
static byte REPEAT_TYPE_NONE
          No Repeat of appointment
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.
 
Constructor Summary
  DateBookRecordEntry()
          DateBookRecordEntry defauit constructor.
protected DateBookRecordEntry(DateBookRecordEntry original)
          Creates a new DateBookRecord entry that is a copy of the provided DateBookRecordEntry.
 
Method Summary
 void addExceptionEntry(java.util.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 java.util.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.
 java.util.Calendar getAlarmTime()
          Get alarm time of appointment.
 byte getAlarmUnitType()
          Getter for property alarmUnitType.
 byte getApptFlags()
          Getter for property apptFlags.
static byte[] getDateBytesFromCalendar(java.util.Calendar c)
          Parse the Calendar and convert to a byte array of date information.
 java.util.Calendar getEndTime()
          Get end time of the appointment.
 java.util.Calendar getExceptionEntry(int i)
          Get the index indicated exception entry.
 int getExceptionEntryCount()
          Get the number of exception entries for this record.
 java.util.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.
 java.util.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(java.util.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(java.util.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(java.util.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(java.util.Calendar repeatEndDate)
          Setter for property repeatEndDate.
 void setRepeatFrequency(byte repeatFrequency)
          Setter for property repeatFrequency.
 void setRepeating(boolean repeating)
          Setter for property repeating.
 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 setStartTime(java.util.Calendar newValue)
          Set the start time for appointment.
 void setWhenInfoChanged(boolean whenInfoChanged)
          Setter for property whenInfoChanged.
 java.lang.String toString()
          Return a human-readable String representation of this record.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rb

protected static java.util.ResourceBundle rb

ALARM_ADVANCE_MINUTES

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

ALARM_ADVANCE_HOURS

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

ALARM_ADVANCE_DAYS

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

NO_TIME

public static final byte NO_TIME
Value used if there is no time.

NO_ALARM

public static final byte NO_ALARM
Value used if there is no alarm.

REPEAT_TYPE_NONE

public static final byte REPEAT_TYPE_NONE
No Repeat of appointment

REPEAT_TYPE_DAILY

public static final byte REPEAT_TYPE_DAILY
Repeat Type is Daily

REPEAT_TYPE_WEEKLY

public static final byte REPEAT_TYPE_WEEKLY
Repeat Type is Weekly

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

REPEAT_TYPE_MONTHLY_BY_DAY_OF_MONTH

public static final byte REPEAT_TYPE_MONTHLY_BY_DAY_OF_MONTH
Repeat Type is Monthly by Date

REPEAT_TYPE_YEARLY

public static final byte REPEAT_TYPE_YEARLY
Repeat Type is yearly (annual)

REPEAT_TYPE_NO_END_DATE

public static final char REPEAT_TYPE_NO_END_DATE
Repeat has no end date.

WHEN_MODIFIED

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

HAS_ALARM_INFO

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

HAS_REPEAT_INFO

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

HAS_NOTE

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

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.

HAS_DESCRIPTION

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

CLEAR_WHEN_MODIFIED

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

CLEAR_HAS_ALARM_INFO

public static final byte CLEAR_HAS_ALARM_INFO
A bitmap used to clear the "has alarm" flag.

CLEAR_HAS_REPEAT_INFO

public static final byte CLEAR_HAS_REPEAT_INFO
A bitmap used to clear the record repeat info.

CLEAR_HAS_NOTE

public static final byte CLEAR_HAS_NOTE
A bitmap used to clear the flag that this record has a note.

CLEAR_HAS_EXCEPTION_INFO

public static final byte CLEAR_HAS_EXCEPTION_INFO
A bitmap used to clear the exception information flag.

CLEAR_HAS_DESCRIPTION

public static final byte CLEAR_HAS_DESCRIPTION
A bitmap used to clear the "has description" flag.

YEAR_MASK

public static final char YEAR_MASK
A mask bitmap to mask the year in a PalmOS encoded date entry.

MONTH_MASK

public static final char MONTH_MASK
A mask bitmap to mask the month in a PalmOS encoded date entry.

DAY_MASK

public static final char DAY_MASK
A mask bitmap to mask the day in a PalmOS encoded date entry.

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.

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.

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.

MAXIMUM_DATE

public static final java.util.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).
Constructor Detail

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 Detail

hasNote

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

setHasNote

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

hasDescription

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

setHasDescription

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

isWhenInfoChanged

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

setWhenInfoChanged

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

isRepeating

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

setRepeating

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

hasAlarmSet

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

setAlarmSet

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

hasExceptionList

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

setExceptionList

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

getAlarmTime

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

getEndTime

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

getStartTime

public java.util.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.

setAlarmTime

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

setEndTime

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

setStartTime

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

getAlarmUnitType

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

setAlarmUnitType

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

getApptFlags

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

setApptFlags

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

getRepeatEndDate

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

setRepeatEndDate

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

getRepeatFrequency

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

setRepeatFrequency

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

getRepeatOn

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

setRepeatOn

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

getRepeatStartOfWeek

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

setRepeatStartOfWeek

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

getRepeatType

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

setRepeatType

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

getAlarmAdvance

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

setAlarmAdvance

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

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.

convertDateTime

public static java.util.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.

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.

isExceptionEntry

protected boolean isExceptionEntry(java.util.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.

addExceptionEntry

public void addExceptionEntry(java.util.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.

getExceptionEntry

public java.util.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.

toString

public java.lang.String toString()
Return a human-readable String representation of this record.
Overrides:
toString in class java.lang.Object
Returns:
A human-readable String representation of this record.

getDateBytesFromCalendar

public static byte[] getDateBytesFromCalendar(java.util.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.

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.