|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.broad.genome.utils.DateParser2
public class DateParser2
A parser for arbitrary date/time strings.
| Field Summary | |
|---|---|
static int |
DD_MM_YY
day/month/year order. |
static int |
DD_YY_MM
day/year/month order. |
static int |
MM_DD_YY
month/day/year order. |
static int |
MM_YY_DD
month/year/day order. |
static int |
MONTH_AFTER_DAY
bit indicating that the month comes after the day. |
static int |
MONTH_BEFORE_DAY
bit indicating that the month comes before the day. |
static int |
YEAR_AFTER_DAY
bit indicating that the year comes after the day. |
static int |
YEAR_AFTER_MONTH
bit indicating that the year comes after the month. |
static int |
YEAR_BEFORE_DAY
bit indicating that the year comes before the day. |
static int |
YEAR_BEFORE_MONTH
bit indicating that the year comes before the month. |
static int |
YY_DD_MM
year/day/month order. |
static int |
YY_MM_DD
year/month/day order. |
| Constructor Summary | |
|---|---|
DateParser2()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getOrderString(int order)
Return a string representation of the order value. |
static int |
monthNameToNumber(java.lang.String str)
Convert the supplied month name to its numeric representation. |
static java.util.Date |
parse_date(java.lang.String dateStr)
|
static java.util.Calendar |
parse(java.lang.String dateStr)
Extract a date from a string, defaulting to YY-MM-DD order for all-numeric strings. |
static java.util.Calendar |
parse(java.lang.String dateStr,
int order)
Extract a date from a string. |
static java.util.Calendar |
parse(java.lang.String dateStr,
int order,
boolean ignoreChanges)
Extract a date from a string. |
static java.lang.String |
prettyString(java.util.Calendar cal)
Return a printable representation of the date. |
static java.lang.String |
toSQLString(java.util.Calendar cal)
Return a string representation of the date suitable for use in an SQL statement. |
static java.lang.String |
toString(java.util.Calendar cal)
Return a basic representation of the string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int YEAR_BEFORE_MONTH
public static final int YEAR_BEFORE_DAY
public static final int MONTH_BEFORE_DAY
public static final int YEAR_AFTER_MONTH
public static final int YEAR_AFTER_DAY
public static final int MONTH_AFTER_DAY
public static final int DD_MM_YY
public static final int MM_DD_YY
public static final int MM_YY_DD
public static final int DD_YY_MM
public static final int YY_DD_MM
public static final int YY_MM_DD
| Constructor Detail |
|---|
public DateParser2()
| Method Detail |
|---|
public static java.lang.String getOrderString(int order)
order - order
public static int monthNameToNumber(java.lang.String str)
str - month name
public static java.util.Calendar parse(java.lang.String dateStr)
throws ParserException
dateStr - date string
ParserException - if there was a problem
parsing the string.
public static java.util.Date parse_date(java.lang.String dateStr)
throws ParserException
ParserException
public static java.util.Calendar parse(java.lang.String dateStr,
int order)
throws ParserException
dateStr - date stringorder - order in which pieces of numeric strings
are assigned (should be one of YY_MM_DD,
MM_DD_YY, etc.)
ParserException - if there was a problem
parsing the string.
public static java.util.Calendar parse(java.lang.String dateStr,
int order,
boolean ignoreChanges)
throws ParserException
dateStr - date stringorder - order in which pieces of numeric strings
are assigned (should be one of YY_MM_DD,
MM_DD_YY, etc.)ignoreChanges - if true, ignore date changes such as
Feb 31 being changed to Mar 3.
ParserException - if there was a problem
parsing the string.public static java.lang.String prettyString(java.util.Calendar cal)
cal - calendar to convert to a string
public static java.lang.String toString(java.util.Calendar cal)
cal - calendar to convert to a string
public static java.lang.String toSQLString(java.util.Calendar cal)
cal - calendar to convert to a string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||