|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.gui4j.util.Day
Represents a day.
Allows to conveniently work with days instead of dates that also include time
info.
| Method Summary | |
int |
compareDay(Day day)
Compares this Day to parameter day. |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object obj)
|
java.util.Date |
getDate()
|
int |
getDayOfWeek()
Returns the day of the week represented by this Day. |
int |
getDiff(Day other)
Returns the number of days between this Day and the
specified Day. the result includes both this and the
specified Day. |
static Day |
getFirstDayOf(int year,
int month)
Returns the first day of the specified month in the specified year. |
Day |
getFirstDayOfMonth()
Returns the first day of the month this Day belongs to. |
static Day |
getFirstDayOfWeek(int year,
int week)
Returns the first day of the specified calendar week in the specified year. |
Day |
getFirstDayOfYear()
Returns the first day of the year this Day belongs to. |
static Day |
getInstance(java.util.Date date)
Public factory method to get an instance of Day from. |
int |
getJahr()
Deprecated. use the english named method getYear() instead. |
int |
getJahrForWeek()
Deprecated. use the english named method getYearForWeek()
instead. |
static Day |
getLastDayOf(int year,
int month)
Returns the last day of the specified month in the specified year. |
static Day |
getLastDayOfYear(int year)
Returns the last day of the specified year. |
int |
getMonat()
Deprecated. replaced by the english named method getMonth(). |
int |
getMonth()
Returns the month this Day belongs to. |
java.lang.String |
getNameTag()
|
java.lang.String |
getShortTag()
|
static Day |
getToday()
Get a Day instance representing today. |
int |
getWeek()
Returns the week of year ("calendar week") this Day belongs to. |
int |
getYear()
Returns the year this Day belongs to. |
int |
getYearForWeek()
Returns the year the week containing this Day belongs to.
|
int |
hashCode()
|
boolean |
isWerktag()
Deprecated. replaced by english named method isWorkday(). |
boolean |
isWorkday()
Decides if this Day is considered to be a working day. |
Day |
nextDay()
Returns the day following this day. |
Day |
nextDay(int diff)
Returns the day diff days after this Day. |
Day |
prevDay()
Returns the previous Day. |
int |
sub(Day otherDay)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public java.util.Date getDate()
public boolean isWorkday()
true, if this Day represents a working day,
false otherwise.public boolean isWerktag()
isWorkday().
isWorkday())public int getDayOfWeek()
Day.
Calendar, i.e. Calendar.SUNDAY through
Calendar.SATURDAY.public int getMonth()
Day belongs to.
Calendar constants
Calendar.JANUARY through Calendar.DECEMBER.public int getMonat()
getMonth().
getMonth())public int getWeek()
Day belongs to.
public int getYear()
Day belongs to.
public int getJahr()
getYear() instead.
public int getYearForWeek()
Day belongs to.
This is not necessarily the year this Day belongs to: if
this Day is part of the first week of a year, the
Day itself could still be in the previous year while the
week belongs to the next year.
Day's week.public int getJahrForWeek()
getYearForWeek()
instead.
getYearForWeek()).public static Day getInstance(java.util.Date date)
Day from.
date - The date for which to create a Day.
public static Day getToday()
Day instance representing today.
Day instance representing today.
public static Day getFirstDayOf(int year,
int month)
year - year (fully qualified, i.e. four digits required)month - month according to usage in Calendar (i.e. 0 is first
month).
public static Day getFirstDayOfWeek(int year,
int week)
Day might not be in the specified year if
calendar week 1 was specified.
year - year (fully qualified, i.e. four digits required)week - calendar week
public static Day getLastDayOf(int year,
int month)
year - year (fully qualified, i.e. four digits required)month - month according to usage in Calendar (i.e. 0 is first
month).
public static Day getLastDayOfYear(int year)
year - year (fully qualified, i.e. four digits required)
public Day nextDay()
public int getDiff(Day other)
Day and the
specified Day. the result includes both this and the
specified Day.
other - Day for which to return the number of days between it and this Day.
May not be null.
- Returns:
- int the number of days between this
Day and the specified Day. public Day nextDay(int diff)
diff days after this Day.nextDay(1) is equivalent to nextDay(),
nextDay(2) returns the day after nextDay() etc.
diff - defines the day to return based on this Day
public Day prevDay()
Day.
public Day getFirstDayOfMonth()
Day belongs to.
Day belongs to.public Day getFirstDayOfYear()
Day belongs to.
Day belongs to.public int sub(Day otherDay)
public int compareDay(Day day)
Day to parameter day.-1 if this Day is earlier than
the specified one. Returns 0 if the Days
denote the same day. Returns 1 otherwise.
day - Day to compare this day to.
public boolean equals(java.lang.Object obj)
Object.equals(Object)public int hashCode()
Object.hashCode()public java.lang.String toString()
Object.toString()public int compareTo(java.lang.Object o)
compareTo in interface java.lang.ComparableComparable.compareTo(Object)public java.lang.String getNameTag()
getNameTag in interface NameableNameable.getNameTag()public java.lang.String getShortTag()
getShortTag in interface NameableNameable.getShortTag()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||