|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.DayNumber
public class DayNumber
Performs convenience function on a "Day Number" Number of days since October 15, 1582 (the first day of the Gregorian Calendar)
Field Summary | |
---|---|
static java.lang.String |
DATE_FORMAT_YMD_1
|
static java.lang.String |
DATE_FORMAT_YMD_2
|
static java.lang.String |
DEFAULT_DATE_FORMAT
|
Constructor Summary | |
---|---|
DayNumber(DayNumber other)
Copy Constructor |
|
DayNumber(int year,
int month1,
int day)
Constructor |
|
DayNumber(long dayNumber)
Constructor |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this DateTime instance |
int |
compareTo(java.lang.Object other)
Compares another DayNumber instance to this instance. |
boolean |
equals(java.lang.Object obj)
Returns true if the specified DayNumber is equal-to this DayNumber instance |
java.lang.String |
format(java.lang.String fmt)
Retuens a formatted Date |
DateTime |
getDateTime(java.util.TimeZone tmz,
int hour24,
int minute,
int second)
Returns a DateTime instance with the time set to the beginning of the day |
DateTime |
getDayEnd(java.util.TimeZone tmz)
Returns a DateTime instance with the time set to the beginning of the day |
long |
getDayNumber()
Gets the Day Number |
int |
getDayOfMonth()
Gets the Day of Month (1..31) |
int |
getDayOfWeek()
Returns the day of the week |
DateTime |
getDayStart(java.util.TimeZone tmz)
Returns a DateTime instance with the time set to the beginning of the day |
int |
getMonth()
Gets the Month (1..12) |
int |
getMonth0()
Gets the 0-based Month (0..11) |
int |
getYear()
Gets the Year |
boolean |
isLeapYear()
Returns true if this year represents a leap-year |
static DayNumber |
parseDayNumber(java.lang.String ymdStr)
Convert specified string to DayNumber. |
java.lang.String |
toString()
Returns a String representation of this instance |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DATE_FORMAT_YMD_1
public static final java.lang.String DATE_FORMAT_YMD_2
public static final java.lang.String DEFAULT_DATE_FORMAT
Constructor Detail |
---|
public DayNumber(long dayNumber)
dayNumber
- The number of days since October 15, 1582public DayNumber(int year, int month1, int day)
year
- The year (>= 1583)month1
- The month (1..12)day
- The day of the monthpublic DayNumber(DayNumber other)
other
- The other DayNumber from which to copyMethod Detail |
---|
public static DayNumber parseDayNumber(java.lang.String ymdStr)
ymdStr
- The date to parse
public long getDayNumber()
public int getYear()
public int getMonth()
public int getMonth0()
public int getDayOfMonth()
public int getDayOfWeek()
public boolean isLeapYear()
public DateTime getDateTime(java.util.TimeZone tmz, int hour24, int minute, int second)
tmz
- The TimeZonehour24
- The 24-hour of the dayminute
- The minute of the hoursecond
- The second of the minute
public DateTime getDayStart(java.util.TimeZone tmz)
tmz
- The TimeZone
public DateTime getDayEnd(java.util.TimeZone tmz)
tmz
- The TimeZone
public java.lang.String format(java.lang.String fmt)
fmt
- The Date/Time format
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other DayNumber instance
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- The other DayNumber instance.
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |