|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.billpringle.utils.wrputils.WrpDate
public class WrpDate
Abstraction of a date object.
![]() |
![]() |
Unless noted otherwise, all materials available for download from my site are copyrighted by Bill Pringle, and are licensed under a Creative Commons License. |
Field Summary | |
---|---|
protected int |
day
day of month |
protected int |
month
month of year |
protected static java.lang.String[] |
months
list of month abbreviations |
protected java.lang.String |
str
string representation of date |
protected int |
year
year value |
Constructor Summary | |
---|---|
WrpDate()
Default constructor |
|
WrpDate(java.lang.String s)
Constructor with a date string |
Method Summary | |
---|---|
int |
getDay()
Get the day |
int |
getMonth()
Get the month |
int |
getYear()
Get the year |
static java.lang.String |
monthAbbr(int MonthNumber)
Get month abbreviation for month number |
static int |
MonthNumber(java.lang.String MonthAbbr)
Convert the name of the month to a number |
private void |
parseStr(java.lang.String s)
Parse the input string and convert to a date |
void |
setDay(int day)
Set the day |
void |
setMonth(int month)
Set the month |
void |
setYear(int year)
Set the year |
java.lang.String |
toString()
Output date in string format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String[] months
protected int year
protected int month
protected int day
protected java.lang.String str
Constructor Detail |
---|
public WrpDate()
public WrpDate(java.lang.String s)
s
- date string (DD Mon YYYY)Method Detail |
---|
public static java.lang.String monthAbbr(int MonthNumber)
MonthNumber
- month number (1-12)
public static int MonthNumber(java.lang.String MonthAbbr)
MonthAbbr
- month name or abbreviation
private void parseStr(java.lang.String s)
s
- date string in format DD Mon YYYYpublic int getYear()
public void setYear(int year)
year
- the year to setpublic int getMonth()
public void setMonth(int month)
month
- the month to setpublic int getDay()
public void setDay(int day)
day
- the day to setpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |