| java.lang.Object org.jfree.data.time.RegularTimePeriod org.jfree.data.time.Month
Constructor Summary | |
public | Month() Constructs a new Month, based on the current system time. | public | Month(int month, int year) Constructs a new month instance. | public | Month(int month, Year year) Constructs a new month instance. | public | Month(Date time) Constructs a new Month instance, based on a date/time and
the default time zone. | public | Month(Date time, TimeZone zone) Constructs a new Month instance, based on a date/time and
a time zone. |
Method Summary | |
public 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.
Parameters: o1 - the object to compare. | public boolean | equals(Object obj) 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. | public long | getFirstMillisecond() Returns the first millisecond of the month. | public long | getFirstMillisecond(Calendar calendar) Returns the first millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
Parameters: calendar - the calendar (null not permitted). | public long | getLastMillisecond() Returns the last millisecond of the month. | public long | getLastMillisecond(Calendar calendar) Returns the last millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
Parameters: calendar - the calendar (null not permitted). | public int | getMonth() Returns the month. | public long | getSerialIndex() Returns a serial index number for the month. | public Year | getYear() Returns the year in which the month falls. | public int | getYearValue() Returns the year in which the month falls. | public int | hashCode() Returns a hash code for this object instance. | public RegularTimePeriod | next() Returns the month following this one. | public static Month | parseMonth(String s) Parses the string argument as a month.
This method is required to accept the format "YYYY-MM". | public 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). | public RegularTimePeriod | previous() Returns the month preceding this one. | public String | toString() Returns a string representing the month (e.g. |
Month | public Month()(Code) | | Constructs a new Month, based on the current system time.
|
Month | public Month(int month, int year)(Code) | | Constructs a new month instance.
Parameters: month - the month (in the range 1 to 12). Parameters: year - the year. |
Month | public Month(int month, Year year)(Code) | | Constructs a new month instance.
Parameters: month - the month (in the range 1 to 12). Parameters: year - the year. |
Month | public Month(Date time)(Code) | | Constructs a new Month instance, based on a date/time and
the default time zone.
Parameters: time - the date/time. |
Month | public Month(Date time, TimeZone zone)(Code) | | 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.
Parameters: time - the date/time. Parameters: zone - the time zone (null not permitted). |
compareTo | public int compareTo(Object o1)(Code) | | Returns an integer indicating the order of this Month object relative to
the specified
object: negative == before, zero == same, positive == after.
Parameters: o1 - the object to compare. negative == before, zero == same, positive == after. |
equals | public boolean equals(Object obj)(Code) | | 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.
Parameters: obj - the object (null permitted). true if month and year of this and object are the same. |
getFirstMillisecond | public long getFirstMillisecond()(Code) | | 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
Month.peg(Calendar) method.
The first millisecond of the month. See Also: Month.getLastMillisecond() |
getFirstMillisecond | public long getFirstMillisecond(Calendar calendar)(Code) | | Returns the first millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
Parameters: calendar - the calendar (null not permitted). The first millisecond of the month. throws: NullPointerException - if calendar is null . |
getLastMillisecond | public long getLastMillisecond()(Code) | | 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
Month.peg(Calendar) method.
The last millisecond of the month. See Also: Month.getFirstMillisecond() |
getLastMillisecond | public long getLastMillisecond(Calendar calendar)(Code) | | Returns the last millisecond of the month, evaluated using the supplied
calendar (which determines the time zone).
Parameters: calendar - the calendar (null not permitted). The last millisecond of the month. throws: NullPointerException - if calendar is null . |
getMonth | public int getMonth()(Code) | | Returns the month. Note that 1=JAN, 2=FEB, ...
The month. |
getSerialIndex | public long getSerialIndex()(Code) | | Returns a serial index number for the month.
The serial index number. |
getYear | public Year getYear()(Code) | | Returns the year in which the month falls.
The year in which the month falls (as a Year object). |
getYearValue | public int getYearValue()(Code) | | Returns the year in which the month falls.
The year in which the month falls (as an int). |
hashCode | public int hashCode()(Code) | | 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
A hash code. |
parseMonth | public static Month parseMonth(String s)(Code) | | 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.
Parameters: s - the string to parse. null if the string is not parseable, the month otherwise. |
peg | public void peg(Calendar calendar)(Code) | | Recalculates the start date/time and end date/time for this time period
relative to the supplied calendar (which incorporates a time zone).
Parameters: calendar - the calendar (null not permitted). since: 1.0.3 |
previous | public RegularTimePeriod previous()(Code) | | Returns the month preceding this one.
The month preceding this one. |
toString | public String toString()(Code) | | Returns a string representing the month (e.g. "January 2002").
To do: look at internationalisation.
A string representing the month. |
|
|