|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.exponto.util.Date
Stores the date (year, month, day) and also has various methodes for converting, finding working days and so one. Basicly written before I got some understanding of the various SDK calendar and date classes Konverterer en string p� formatet yyyymmdd til int year, month og day. yyyy m� v�re mellom 1700 og 2300, mm 1 til 12 og dd 1 til 31. Ingen sjekk p� dd sammen med mm Bruker av og til JDK's greogorianske kalender, der januar er 0, desember er 11. S�ndag er 1 og l�rdag er 7. Kunne v�rt noe bedre h�ndtering av feilformaterte strenger, eg brukt exceptions
Field Summary | |
int |
day
|
int |
dayInWeek
|
int |
month
|
static java.lang.String[] |
monthsShort
(English) Abbrivations for names of months |
int |
week
|
int |
year
|
Constructor Summary | |
Date()
Creates new date |
|
Date(Date d,
int weekOffset)
Creates a new Date with value (d - number of weeks) A positive weekOffset gives an earlier date |
|
Date(int y,
int m,
int d)
|
|
Date(java.lang.String s)
|
Method Summary | |
void |
addDay()
|
int |
check()
|
int |
compareDate(Date d)
Compare this day with another day (year, month and day) Returns 0 if both dates are the same -1/1 if year and month is equal, but date is different -2/2 if year is equal but month is different -4/4 if year is different 8 if total failure. |
int |
compareWeek(Date d)
|
void |
convert(java.lang.String s)
|
void |
findWeekDay()
|
static Date |
getNewDate(Date d,
int field,
int amount)
Adds (or subtracts) an amount of time (days, months or year) to the date. |
Date |
klone()
|
void |
setToNextWorkDay()
|
void |
setToPreviousWorkDay()
Sets this day to the previous working day (that is mon -fri). |
java.lang.String |
toDigitString()
Returns the date as yyyymmdd |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String[] monthsShort
public int year
public int month
public int day
public int week
public int dayInWeek
Constructor Detail |
public Date()
public Date(int y, int m, int d)
public Date(java.lang.String s)
public Date(Date d, int weekOffset)
Method Detail |
public void convert(java.lang.String s)
public int check()
public void findWeekDay()
public void addDay()
public void setToNextWorkDay()
public void setToPreviousWorkDay()
public static Date getNewDate(Date d, int field, int amount)
d
- Datefield
- Which field to addamount
- The amount to de/increase the field
public Date klone()
public int compareDate(Date d)
public int compareWeek(Date d)
public java.lang.String toString()
public java.lang.String toDigitString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |