java.lang.Object | ||
↳ | org.jfree.data.time.RegularTimePeriod | |
↳ | org.jfree.data.time.Month |
Represents a single month. This class is immutable, which is a requirement
for all RegularTimePeriod
subclasses.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new Month, based on the current system time.
| |||||||||||
Constructs a new month instance.
| |||||||||||
Constructs a new month instance.
| |||||||||||
Constructs a new
Month instance, based on a date/time and
the default time zone. | |||||||||||
This constructor is deprecated.
Since 1.0.12, use
Month(Date, TimeZone, Locale)
instead.
| |||||||||||
Creates a new
Month instance, based on the specified time,
zone and locale. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an integer indicating the order of this Month object relative to
the specified
object: negative == before, zero == same, positive == after.
| |||||||||||
Tests the equality of this Month object to an arbitrary object.
| |||||||||||
Returns the first millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
| |||||||||||
Returns the first millisecond of the month.
| |||||||||||
Returns the last millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
| |||||||||||
Returns the last millisecond of the month.
| |||||||||||
Returns the month.
| |||||||||||
Returns a serial index number for the month.
| |||||||||||
Returns the year in which the month falls.
| |||||||||||
Returns the year in which the month falls.
| |||||||||||
Returns a hash code for this object instance.
| |||||||||||
Returns the month following this one.
| |||||||||||
Parses the string argument as a month.
| |||||||||||
Recalculates the start date/time and end date/time for this time period
relative to the supplied calendar (which incorporates a time zone).
| |||||||||||
Returns the month preceding this one.
| |||||||||||
Returns a string representing the month (e.g.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a new Month, based on the current system time.
Constructs a new month instance.
month | the month (in the range 1 to 12). |
---|---|
year | the year. |
Constructs a new month instance.
month | the month (in the range 1 to 12). |
---|---|
year | the year. |
Constructs a new Month
instance, based on a date/time and
the default time zone.
time | the date/time (null not permitted). |
---|
This constructor is deprecated.
Since 1.0.12, use Month(Date, TimeZone, Locale)
instead.
Constructs a new 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.
time | the date/time. |
---|---|
zone | the time zone (null not permitted). |
Creates a new Month
instance, based on the specified time,
zone and locale.
time | the current time. |
---|---|
zone | the time zone. |
locale | the locale. |
Returns an integer indicating the order of this Month object relative to the specified object: negative == before, zero == same, positive == after.
o1 | the object to compare. |
---|
Tests the equality of this Month object to an arbitrary object. Returns true if the target is a Month instance representing the same month as this object. In all other cases, returns false.
obj | the object (null permitted). |
---|
true
if month and year of this and object are the
same.
Returns the first millisecond of the month, evaluated using the supplied calendar (which determines the time zone).
calendar | the calendar (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the first millisecond of the month. This will be determined
relative to the time zone specified in the constructor, or in the
calendar instance passed in the most recent call to the
peg(Calendar)
method.
Returns the last millisecond of the month, evaluated using the supplied calendar (which determines the time zone).
calendar | the calendar (null not permitted). |
---|
NullPointerException | if calendar is
null .
|
---|
Returns the last millisecond of the month. This will be
determined relative to the time zone specified in the constructor, or
in the calendar instance passed in the most recent call to the
peg(Calendar)
method.
Returns the month. Note that 1=JAN, 2=FEB, ...
Returns a serial index number for the month.
Returns the year in which the month falls.
Returns the year in which the month falls.
Returns a hash code for this object instance. The approach described by Joshua Bloch in "Effective Java" has been used here:
http://developer.java.sun.com/developer/Books/effectivejava
/Chapter3.pdf
Returns the month following this one. Note that the returned
Month
is "pegged" using the default time-zone, irrespective of
the time-zone used to peg of the current month (which is not recorded
anywhere). See the peg(Calendar)
method.
Parses the string argument as a month. This method is required to accept the format "YYYY-MM". It will also accept "MM-YYYY". Anything else, at the moment, is a bonus.
s | the string to parse (null permitted). |
---|
null
if the string is not parseable, the month
otherwise.
Recalculates the start date/time and end date/time for this time period relative to the supplied calendar (which incorporates a time zone).
calendar | the calendar (null not permitted). |
---|
Returns the month preceding this one. Note that the returned
Month
is "pegged" using the default time-zone, irrespective of
the time-zone used to peg of the current month (which is not recorded
anywhere). See the peg(Calendar)
method.
Returns a string representing the month (e.g. "January 2002").
To do: look at internationalisation.