org.jSyncManager.API.Protocol.Util
Class DLP_Date
java.lang.Objectorg.jSyncManager.API.Protocol.Util.DLP_Date
- Serializable
public class DLP_Date
extends java.lang.Object
implements Serializable
A class to hold a Palm DLP protocol Date element.
This class holds date information.
static long | JAN1_1904_MS_FROM_EPOCH
|
static char | VFS_CREATION_DATE- A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files creation date.
|
static char | VFS_LAST_ACCESSED_DATE- A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files last acccess date.
|
static char | VFS_MODIFICATION_DATE- A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files modification date.
|
DLP_Date()- Creates a new DLP date object using the current date and time.
|
DLP_Date(Calendar calendar)- Create a new DLP date object using the specified date and time
|
DLP_Date(data[] )- Create a new DLP date object with the specified DLP formatted date bytes.
|
static char | calendar2DateType(Calendar calendar)- Converts the provided Calendar object to a DLP two-byte Date representation.
|
static long | calendar2Seconds(Calendar calendar)- Converts a calendar object to a long representing seconds since January 1st, 1904 @ 00:00.
|
byte[] | convertToBytes()- Convert this date/time object to a series of DLP date/time bytes.
|
Calendar | convertToCalendar()- Converts this date object to a Calendar object.
|
long | convertToSeconds()- Convert this date object to the number of seconds since Jan 1st, 1904 @ 0000.
|
static Calendar | dateType2Calendar(data[] , int i)- Convert the provided date byte array into a Calendar object.
|
static DLP_Date | emptyDate()- Creates a new empty DLP Date object.
|
static Calendar | seconds2Calendar(long i)- Convert a value representing seconds since Jan 1st 1904 @ 0000 to a Calendar object.
|
String | toString()- Retreive this object as human-readable text.
|
JAN1_1904_MS_FROM_EPOCH
public static final long JAN1_1904_MS_FROM_EPOCH
VFS_CREATION_DATE
public static final char VFS_CREATION_DATE
A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files creation date.
VFS_LAST_ACCESSED_DATE
public static final char VFS_LAST_ACCESSED_DATE
A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files last acccess date.
VFS_MODIFICATION_DATE
public static final char VFS_MODIFICATION_DATE
A value for use when calling get/setVFSFileDate in order to specify
that you wish to request the files modification date.
DLP_Date
public DLP_Date()
Creates a new DLP date object using the current date and time.
DLP_Date
public DLP_Date(Calendar calendar)
throws InvalidDLPDateExceptionCreate a new DLP date object using the specified date and time
calendar - the date and time you want to set this date object to.
DLP_Date
public DLP_Date(data[] )
throws InvalidDLPDateExceptionCreate a new DLP date object with the specified DLP formatted date bytes.
calendar2DateType
public static char calendar2DateType(Calendar calendar)
Converts the provided Calendar object to a DLP two-byte Date representation.
calendar - the date to convert.
- a char representing the date portion of the provided calendar object.
calendar2Seconds
public static long calendar2Seconds(Calendar calendar)
Converts a calendar object to a long representing seconds since January 1st, 1904 @ 00:00.
calendar - a java.util.Calendar instance containing the time you want to convert.
- a long representing seconds since January 1st, 1904 @ 00:00.
convertToBytes
public byte[] convertToBytes()
Convert this date/time object to a series of DLP date/time bytes.
- a series of bytes representing this date object.
convertToCalendar
public Calendar convertToCalendar()
Converts this date object to a Calendar object.
The current implementation will actually create a GregorianCalendar object,
and will return it as a Calendar object.
- this date object represented as a Calendar object.
convertToSeconds
public long convertToSeconds()
Convert this date object to the number of seconds since Jan 1st, 1904 @ 0000.
- the number of seconds since Jan 1st, 1904 @ 0000.
dateType2Calendar
public static Calendar dateType2Calendar(data[] ,
int i)Convert the provided date byte array into a Calendar object.
i - the offset into the array where the date information starts.
- the provided date byte array as a Calendar object.
emptyDate
public static DLP_Date emptyDate()
Creates a new empty DLP Date object.
This constructor will create a DLP date with year (and all other fields) set to 0.
- a new empty DLP Date object.
seconds2Calendar
public static Calendar seconds2Calendar(long i)
Convert a value representing seconds since Jan 1st 1904 @ 0000 to a Calendar object.
i - a value representing seconds since Jan 1st 1904 @ 0000.
- a Calendar object containing the date and time represented by the input.
toString
public String toString()
Retreive this object as human-readable text.
- this object as human-readable text.