|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.data.TimePeriod
com.jrefinery.data.Month
public class Month
Represents a single month.
This class is immutable, which is a requirement for all TimePeriod subclasses.
| Field Summary | |
|---|---|
protected int |
month
The month (1-12). |
protected Year |
year
The year in which the month falls. |
| Fields inherited from class com.jrefinery.data.TimePeriod |
|---|
DEFAULT_TIME_ZONE, WORKING_CALENDAR |
| Fields inherited from interface com.jrefinery.date.MonthConstants |
|---|
APRIL, AUGUST, DECEMBER, FEBRUARY, JANUARY, JULY, JUNE, MARCH, MAY, NOVEMBER, OCTOBER, SEPTEMBER |
| Constructor Summary | |
|---|---|
Month()
Constructs a new Month, based on the current system time. |
|
Month(java.util.Date time)
Constructs a Month, based on a date/time and the default time zone. |
|
Month(java.util.Date time,
java.util.TimeZone zone)
Constructs a Month, based on a date/time and a time zone. |
|
Month(int month,
int year)
Constructs a new month instance. |
|
Month(int month,
Year year)
Constructs a new month instance. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o1)
Returns an integer indicating the order of this Month object relative to the specified object: negative == before, zero == same, positive == after. |
boolean |
equals(java.lang.Object obj)
Tests the equality of this Month object to an arbitrary object. |
long |
getEnd(java.util.Calendar calendar)
Returns the last millisecond of the month, evaluated using the supplied calendar (which determines the time zone). |
int |
getMonth()
Returns the month. |
long |
getStart(java.util.Calendar calendar)
Returns the first millisecond of the month, evaluated using the supplied calendar (which determines the time zone). |
Year |
getYear()
Returns the year in which the month falls. |
int |
getYearValue()
Returns the year in which the month falls. |
TimePeriod |
next()
Returns the month following this one. |
static Month |
parseMonth(java.lang.String s)
Parses the string argument as a month. |
TimePeriod |
previous()
Returns the month preceding this one. |
java.lang.String |
toString()
Returns a string representing the month (e.g. |
| Methods inherited from class com.jrefinery.data.TimePeriod |
|---|
getEnd, getEnd, getMiddle, getMiddle, getMiddle, getStart, getStart |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int month
protected Year year
| Constructor Detail |
|---|
public Month()
public Month(int month,
int year)
month - The month (in the range 1 to 12).year - The year.
public Month(int month,
Year year)
month - The month (in the range 1 to 12).year - The year.public Month(java.util.Date time)
time - The date/time.
public Month(java.util.Date time,
java.util.TimeZone zone)
time - The date/time.zone - The time zone.| Method Detail |
|---|
public Year getYear()
public int getYearValue()
public int getMonth()
public TimePeriod previous()
previous in class TimePeriodpublic TimePeriod next()
next in class TimePeriodpublic java.lang.String toString()
To do: look at internationalisation.
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobject - The object.public int compareTo(java.lang.Object o1)
public long getStart(java.util.Calendar calendar)
getStart in class TimePeriodcalendar - The calendar.
public long getEnd(java.util.Calendar calendar)
getEnd in class TimePeriodcalendar - The calendar.
public static Month parseMonth(java.lang.String s)
throws TimePeriodFormatException
This method is required to accept the format "YYYY-MM". It will also accept "MM-YYYY". Anything else, at the moment, is a bonus.
TimePeriodFormatException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||