java.lang.Object | ||
↳ | org.jfree.data.time.RegularTimePeriod | |
↳ | org.jfree.data.time.Quarter |
Defines a quarter (in a given year). The range supported is Q1 1900 to
Q4 9999. This class is immutable, which is a requirement for all
RegularTimePeriod
subclasses.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FIRST_QUARTER | Constant for quarter 1. | |||||||||
int | LAST_QUARTER | Constant for quarter 4. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FIRST_MONTH_IN_QUARTER | The first month in each quarter. | ||||||||||
LAST_MONTH_IN_QUARTER | The last month in each quarter. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new Quarter, based on the current system date/time.
| |||||||||||
Constructs a new quarter.
| |||||||||||
Constructs a new quarter.
| |||||||||||
Constructs a new instance, based on a date/time and the default time
zone.
| |||||||||||
This constructor is deprecated.
Since 1.0.12, use
Quarter(Date, TimeZone, Locale)
instead.
| |||||||||||
Creates a new
Quarter instance, using the specified
zone and locale. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an integer indicating the order of this Quarter object relative
to the specified object:
negative == before, zero == same, positive == after.
| |||||||||||
Tests the equality of this Quarter object to an arbitrary object.
| |||||||||||
Returns the first millisecond in the Quarter, evaluated using the
supplied calendar (which determines the time zone).
| |||||||||||
Returns the first millisecond of the quarter.
| |||||||||||
Returns the last millisecond of the Quarter, evaluated using the
supplied calendar (which determines the time zone).
| |||||||||||
Returns the last millisecond of the quarter.
| |||||||||||
Returns the quarter.
| |||||||||||
Returns a serial index number for the quarter.
| |||||||||||
Returns the year.
| |||||||||||
Returns the year.
| |||||||||||
Returns a hash code for this object instance.
| |||||||||||
Returns the quarter following this one.
| |||||||||||
Parses the string argument as a quarter.
| |||||||||||
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 quarter preceding this one.
| |||||||||||
Returns a string representing the quarter (e.g.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constant for quarter 1.
Constant for quarter 4.
The first month in each quarter.
The last month in each quarter.
Constructs a new Quarter, based on the current system date/time.
Constructs a new quarter.
quarter | the quarter (1 to 4). |
---|---|
year | the year (1900 to 9999). |
Constructs a new quarter.
quarter | the quarter (1 to 4). |
---|---|
year | the year (1900 to 9999). |
Constructs a new 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 Quarter(Date, TimeZone, Locale)
instead.
Constructs a Quarter, based on a date/time and time zone.
time | the date/time. |
---|---|
zone | the zone (null not permitted). |
Creates a new Quarter
instance, using the specified
zone and locale.
time | the current time. |
---|---|
zone | the time zone. |
locale | the locale. |
Returns an integer indicating the order of this Quarter object relative to the specified object: negative == before, zero == same, positive == after.
o1 | the object to compare |
---|
Tests the equality of this Quarter object to an arbitrary object.
Returns true
if the target is a Quarter instance
representing the same quarter as this object. In all other cases,
returns false
.
obj | the object (null permitted). |
---|
true
if quarter and year of this and the object are
the same.
Returns the first millisecond in the Quarter, 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 quarter. 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 Quarter, 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 quarter. 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 quarter.
Returns a serial index number for the quarter.
Returns the year.
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 quarter following this one.
Parses the string argument as a quarter.
This method should accept the following formats: "YYYY-QN" and "QN-YYYY", where the "-" can be a space, a forward-slash (/), comma or a dash (-).
s | A string representing the quarter. |
---|
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 quarter preceding this one.
null
if this is
Q1 1900).
Returns a string representing the quarter (e.g. "Q1/2002").