|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.util.Date
The Date class is a general date data type(Object) that is similar to those built in to other languages. It supports all days from January 1st, 1983 through December 31st, 2999. It checks to make sure that the dates that are instanciated or changed exist and if they don't it defaults at today. It provides methods to advance the date backwards and forwards by increments of day, week, and month. It provides comparisons =,>,<. Added by Allan C. Solomon and modified by guich.
Field Summary | |
static int |
APRIL
|
static int |
AUGUST
|
static boolean |
BACKWARD
|
static int |
DECEMBER
|
static int |
FEBRUARY
|
static boolean |
FORWARD
|
static int |
FRIDAY
|
static int |
JANUARY
|
static int |
JULY
|
static int |
JUNE
|
static int |
MARCH
|
static int |
MAY
|
static int |
MONDAY
|
static int |
NOVEMBER
|
static int |
OCTOBER
|
static int |
SATURDAY
|
static int |
SEPTEMBER
|
static int |
SUNDAY
|
static int |
THRUSDAY
|
static int |
TUESDAY
|
static int |
WEDNESDAY
|
Constructor Summary | |
Date()
Constructs a Date object set to the current date. |
|
Date(int sentDate)
Constructs a Date object set to the passed int in the YYYYMMDD format |
|
Date(int sentDay,
int sentMonth,
int sentYear)
Constructs a Date object set to the passed day, month, and year. |
|
Date(java.lang.String strDate)
Constructs a Date object set to a passed string in the format specified in the palm preferences. |
|
Date(java.lang.String strDate,
byte dateFormat)
Constructs a Date object set to a passed string in the format specified in the dateFormat parameter (it must be one of the DATE_XXX constants). |
Method Summary | |
void |
advance(int numberDays)
Advances the date by a passed integer. |
void |
advanceMonth()
Advances the date to the beginning of the next month. |
void |
advanceMonth(boolean b)
Advances the date to the beginning of the next or previous month. |
void |
advanceWeek()
Advances the date to the beginning of the next week. |
void |
advanceWeek(boolean b)
Advances the date to the beginning of the next or previous week. |
boolean |
equals(Date sentDate)
Checks to see if the Date object passed occurs at the same time as the existing Date object. |
static java.lang.String |
formatDate(int day,
int month,
int year)
formats the date specified with the palm preferences, zero padded. |
static java.lang.String |
formatDate(int day,
int month,
int year,
byte dateFormat)
formats the date specified with the dateFormat parameter, zero padded. |
java.lang.String |
formatDayMonth()
formats the day/month specified with the Settings.dateFormat, zero padded. |
java.lang.String |
getDate()
Returns the date in a string format. |
int |
getDateInt()
Returns the date in a integer format. |
int |
getDay()
Returns the day. |
int |
getDayOfWeek()
Returns the day of week |
int |
getDaysInMonth()
Returns number of days in the set month. |
int |
getDaysInMonth(int month)
|
int |
getMonth()
Returns the month. |
static java.lang.String |
getMonthName(int m)
|
int |
getWeek()
Calculates and returns the ordinal value of the week(1-52). |
int |
getYear()
Returns the year. |
boolean |
isAfter(Date sentDate)
Checks to see if the Date object passed occurs after the existing Date object. |
boolean |
isBefore(Date sentDate)
Checks to see if the Date object passed occurs before the existing Date object. |
void |
setToday()
sets this date object to be the current day |
java.lang.String |
toString()
Returns the date in a string format. |
Methods inherited from class java.lang.Object |
hashCode |
Field Detail |
public static final int SUNDAY
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THRUSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int JANUARY
public static final int FEBRUARY
public static final int MARCH
public static final int APRIL
public static final int MAY
public static final int JUNE
public static final int JULY
public static final int AUGUST
public static final int SEPTEMBER
public static final int OCTOBER
public static final int NOVEMBER
public static final int DECEMBER
public static final boolean FORWARD
public static final boolean BACKWARD
Constructor Detail |
public Date()
public Date(java.lang.String strDate, byte dateFormat)
strDate-
- string that should have the format specified in the palm preferences. Note: does not have to be seperated by
the '-' character it can be seperated by any non-number.public Date(java.lang.String strDate)
strDate-
- string that should have the format specified in the palm preferences. Note: does not have to be seperated by
the '-' character it can be seperated by any non-number.public Date(int sentDate)
sentDate
- - an integer in the YYYYMMDD formatpublic Date(int sentDay, int sentMonth, int sentYear)
sentDay
- - an integer that must be between 1 and the last day in the month.sentMonth
- - an integer that must be between 1 and 12.sentYear
- - an integer that must be between 1983 and 2999.Method Detail |
public void setToday()
public int getDayOfWeek()
public int getDay()
public int getMonth()
public int getYear()
public int getWeek()
public java.lang.String formatDayMonth()
public static java.lang.String formatDate(int day, int month, int year, byte dateFormat)
public static java.lang.String formatDate(int day, int month, int year)
public java.lang.String getDate()
public java.lang.String toString()
public int getDateInt()
public int getDaysInMonth()
public int getDaysInMonth(int month)
public static java.lang.String getMonthName(int m)
public boolean isBefore(Date sentDate)
Date
- object to compare with existing.public boolean isAfter(Date sentDate)
Date
- object to compare with existing.public boolean equals(Date sentDate)
Date
- object to compare with existing.public void advanceWeek()
public void advanceWeek(boolean b)
b
- - static variables FORWARD or BACKWARD instructs the method to either move to the next
or previous weekpublic void advanceMonth()
public void advanceMonth(boolean b)
b
- - static variables FORWARD or BACKWARD instructs the method to either move to the next
or previous monthpublic void advance(int numberDays)
numberDays
- - integer containing number of days that the date should change can be positive or
negitive
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |