public class DateRecord extends Date
DateRecord class exposes almost the same set of interface as Date class with only a few exceptions. The main purpose is the record all the information during parsing phase and resolve them in a later time when all information can be processed together.
| Constructor and Description |
|---|
DateRecord()
Initialize DateExt object with default value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
calcDate(Date date,
boolean strict)
calcDate uses all the field available so far to fill a Date object.
|
void |
setAmbiguousYear(boolean ambiguousYear)
Set ambiguous year field.
|
void |
setAmpm(int ampm)
Set morning/afternoon field.
|
void |
setDayOfMonth(int day)
Set dayOfMonth field.
|
void |
setDayOfWeek(int dayOfWeek)
Set dayOfWeek field.
|
void |
setEra(int era)
Set Era field.
|
void |
setHours(int hours)
Set hour field.
|
void |
setMidnightIs24(boolean midnightIs24)
Set midnightIs24 field.
|
void |
setMilliseconds(int milliseconds)
Set milliseconds field.
|
void |
setMinutes(int minutes)
Set minute field.
|
void |
setMonth(int month)
Set month field.
|
void |
setSeconds(int seconds)
Set seconds field.
|
void |
setTzOffset(int tzOffset)
Set timezone offset, in minutes.
|
void |
setYear(int value)
Set year field.
|
after, before, clone, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setTime, toGMTString, toInstant, toLocaleString, toString, UTCpublic static final int AM
public static final int PM
public DateRecord()
public boolean calcDate(Date date, boolean strict)
If the strict option is set to true, calcDate will calculate certain invalid dates by wrapping around as needed. For example, February 30 will wrap to March 2.
date - The Date object being filled. Its value should be set to an acceptable default
before pass in to this methodstrict - true to be strict when parsingpublic void setAmbiguousYear(boolean ambiguousYear)
ambiguousYear - true if it is ambiguous year.public void setAmpm(int ampm)
ampm - ampm value.public void setDayOfMonth(int day)
day - dayOfMonth valuepublic void setDayOfWeek(int dayOfWeek)
dayOfWeek - day of the week.public void setEra(int era)
era - era value being set.public void setHours(int hours)
public void setMidnightIs24(boolean midnightIs24)
midnightIs24 - whether an hour value of 24 signifies midnight.public void setMilliseconds(int milliseconds)
milliseconds - milliseconds value.public void setMinutes(int minutes)
setMinutes in class Dateminutes - minute value.public void setMonth(int month)
public void setSeconds(int seconds)
setSeconds in class Dateseconds - second value.public void setTzOffset(int tzOffset)
tzOffset - timezone offset.Copyright © 2018–2020. All rights reserved.