class ParserState
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
day
day of month.
|
private int |
hour
hour (0-23).
|
private int |
milli
millisecond (0-999).
|
private int |
minute
minute (0-59).
|
private int |
month
month (0-11).
|
(package private) static int |
MONTH_AFTER_DAY
bit indicating that the month comes after the day.
|
(package private) static int |
MONTH_BEFORE_DAY
bit indicating that the month comes before the day.
|
private boolean |
monthBeforeDay
true if month should appear before day.
|
private int |
second
second (0-59).
|
private boolean |
timePostMeridian
true if time is after noon.
|
private java.util.TimeZone |
timeZone
time zone (use default time zone if this is null).
|
(package private) static int |
UNSET
value indicating an unset variable.
|
private int |
year
year.
|
(package private) static int |
YEAR_AFTER_DAY
bit indicating that the year comes after the day.
|
(package private) static int |
YEAR_AFTER_MONTH
bit indicating that the year comes after the month.
|
(package private) static int |
YEAR_BEFORE_DAY
bit indicating that the year comes before the day.
|
(package private) static int |
YEAR_BEFORE_MONTH
bit indicating that the year comes before the month.
|
private boolean |
yearBeforeDay
true if year should appear before day.
|
private boolean |
yearBeforeMonth
true if year should appear before month.
|
Constructor and Description |
---|
ParserState(int order)
Create parser state for the specified order.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getDate()
Get day of month.
|
(package private) int |
getHour()
Get hour.
|
(package private) int |
getMillisecond()
Get millisecond.
|
(package private) int |
getMinute()
Get minute.
|
(package private) int |
getMonth()
Get month.
|
(package private) int |
getSecond()
Get second.
|
(package private) java.util.TimeZone |
getTimeZone()
Get time zone.
|
(package private) int |
getYear()
Get year.
|
(package private) boolean |
isDateSet()
Is day of month value set?
|
(package private) boolean |
isHourSet()
Is hour value set?
|
(package private) boolean |
isMillisecondSet()
Is millisecond value set?
|
(package private) boolean |
isMinuteSet()
Is minute value set?
|
(package private) boolean |
isMonthBeforeDay()
Is a numeric month placed before a numeric day of month?
|
(package private) boolean |
isMonthSet()
Is month value set?
|
(package private) boolean |
isSecondSet()
Is second value set?
|
(package private) boolean |
isTimePostMeridian()
Is the time post-meridian (i.e.
|
(package private) boolean |
isYearBeforeDay()
Is a numeric year placed before a numeric day of month?
|
(package private) boolean |
isYearBeforeMonth()
Is a numeric year placed before a numeric month?
|
(package private) boolean |
isYearSet()
Is year value set?
|
(package private) void |
setCalendar(java.util.GregorianCalendar cal,
boolean ignoreChanges)
Fill the calendar with the parsed date.
|
(package private) void |
setDate(int val)
Set the day of month value.
|
(package private) void |
setHour(int val)
Set the hour value.
|
(package private) void |
setMillisecond(int val)
Set the millisecond value.
|
(package private) void |
setMinute(int val)
Set the minute value.
|
(package private) void |
setMonth(int val)
Set the month value.
|
(package private) void |
setSecond(int val)
Set the second value.
|
(package private) void |
setTimePostMeridian(boolean val)
Set the AM/PM indicator value.
|
(package private) void |
setTimeZone(java.util.TimeZone tz)
Set the time zone.
|
(package private) void |
setYear(int val)
Set the year value.
|
static final int YEAR_BEFORE_MONTH
static final int YEAR_BEFORE_DAY
static final int MONTH_BEFORE_DAY
static final int YEAR_AFTER_MONTH
static final int YEAR_AFTER_DAY
static final int MONTH_AFTER_DAY
static final int UNSET
private boolean yearBeforeMonth
private boolean yearBeforeDay
private boolean monthBeforeDay
private int year
private int month
private int day
private int hour
private int minute
private int second
private int milli
private boolean timePostMeridian
private java.util.TimeZone timeZone
ParserState(int order)
order
- YY_MM_DD, MM_DD_YY, etc.int getDate()
int getHour()
int getMillisecond()
int getMinute()
int getMonth()
int getSecond()
java.util.TimeZone getTimeZone()
int getYear()
boolean isDateSet()
boolean isHourSet()
boolean isMillisecondSet()
boolean isMinuteSet()
boolean isMonthBeforeDay()
boolean isMonthSet()
boolean isSecondSet()
boolean isTimePostMeridian()
boolean isYearBeforeDay()
boolean isYearBeforeMonth()
boolean isYearSet()
void setCalendar(java.util.GregorianCalendar cal, boolean ignoreChanges) throws CalendarParserException
cal
- calendar to fillignoreChanges
- if true, throw an exception when a date
like Sept 31 is changed to Oct 1CalendarParserException
- if the date cannot be set for some
reasonvoid setDate(int val) throws CalendarParserException
val
- day of month valueCalendarParserException
- if the value is not a valid day of monthvoid setHour(int val) throws CalendarParserException
val
- hour valueCalendarParserException
- if the value is not a valid hourvoid setMillisecond(int val) throws CalendarParserException
val
- millisecond valueCalendarParserException
- if the value is not a valid millisecondvoid setMinute(int val) throws CalendarParserException
val
- minute valueCalendarParserException
- if the value is not a valid minutevoid setMonth(int val) throws CalendarParserException
val
- month valueCalendarParserException
- if the value is not a valid monthvoid setSecond(int val) throws CalendarParserException
val
- second valueCalendarParserException
- if the value is not a valid secondvoid setTimePostMeridian(boolean val)
val
- true if time represented is after noonvoid setTimeZone(java.util.TimeZone tz)
tz
- time zonevoid setYear(int val) throws CalendarParserException
val
- year valueCalendarParserException
- if the value is not a valid year