org.jfree.data.time
public class Month extends RegularTimePeriod implements Serializable
Constructor Summary | |
---|---|
Month()
Constructs a new Month, based on the current system time. | |
Month(int month, int year)
Constructs a new month instance.
| |
Month(int month, Year year)
Constructs a new month instance.
| |
Month(Date time)
Constructs a new Month instance, based on a date/time and
the default time zone.
| |
Month(Date time, TimeZone zone)
Constructs a new Month instance, based on a date/time and
a time zone. |
Method Summary | |
---|---|
int | compareTo(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(Object obj)
Tests the equality of this Month object to an arbitrary object.
|
long | getFirstMillisecond()
Returns the first millisecond of the month. |
long | getFirstMillisecond(Calendar calendar)
Returns the first millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
|
long | getLastMillisecond()
Returns the last millisecond of the month. |
long | getLastMillisecond(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 | getSerialIndex()
Returns a serial index number for the month.
|
Year | getYear()
Returns the year in which the month falls.
|
int | getYearValue()
Returns the year in which the month falls.
|
int | hashCode()
Returns a hash code for this object instance. |
RegularTimePeriod | next()
Returns the month following this one.
|
static Month | parseMonth(String s)
Parses the string argument as a month.
|
void | peg(Calendar calendar)
Recalculates the start date/time and end date/time for this time period
relative to the supplied calendar (which incorporates a time zone).
|
RegularTimePeriod | previous()
Returns the month preceding this one.
|
String | toString()
Returns a string representing the month (e.g. |
Parameters: month the month (in the range 1 to 12). year the year.
Parameters: month the month (in the range 1 to 12). year the year.
Month
instance, based on a date/time and
the default time zone.
Parameters: time the date/time.
Month
instance, based on a date/time and
a time zone. The first and last millisecond values are initially
pegged to the given time zone also.
Parameters: time the date/time. zone the time zone (null
not permitted).
Parameters: o1 the object to compare.
Returns: negative == before, zero == same, positive == after.
Parameters: obj the object (null
permitted).
Returns: true
if month and year of this and object are the
same.
Returns: The first millisecond of the month.
See Also: getLastMillisecond
Parameters: calendar the calendar (null
not permitted).
Returns: The first millisecond of the month.
Throws: NullPointerException if calendar
is
null
.
Returns: The last millisecond of the month.
See Also: getFirstMillisecond
Parameters: calendar the calendar (null
not permitted).
Returns: The last millisecond of the month.
Throws: NullPointerException if calendar
is
null
.
Returns: The month.
Returns: The serial index number.
Returns: The year in which the month falls (as a Year object).
Returns: The year in which the month falls (as an int).
http://developer.java.sun.com/developer/Books/effectivejava
/Chapter3.pdf
Returns: A hash code.
Returns: The month following this one.
This method is required to accept the format "YYYY-MM". It will also accept "MM-YYYY". Anything else, at the moment, is a bonus.
Parameters: s the string to parse.
Returns: null
if the string is not parseable, the month
otherwise.
Parameters: calendar the calendar (null
not permitted).
Since: 1.0.3
Returns: The month preceding this one.
To do: look at internationalisation.
Returns: A string representing the month.