org.jfree.data.time
public class Quarter extends RegularTimePeriod implements Serializable
Field Summary | |
---|---|
static int[] | FIRST_MONTH_IN_QUARTER The first month in each quarter. |
static int | FIRST_QUARTER Constant for quarter 1. |
static int[] | LAST_MONTH_IN_QUARTER The last month in each quarter. |
static int | LAST_QUARTER Constant for quarter 4. |
Constructor Summary | |
---|---|
Quarter()
Constructs a new Quarter, based on the current system date/time. | |
Quarter(int quarter, int year)
Constructs a new quarter.
| |
Quarter(int quarter, Year year)
Constructs a new quarter.
| |
Quarter(Date time)
Constructs a new instance, based on a date/time and the default time
zone.
| |
Quarter(Date time, TimeZone zone)
Constructs a Quarter, based on a date/time and time zone.
| |
Quarter(Date time, TimeZone zone, Locale locale)
Creates a new Quarter instance, using the specified
zone and locale.
|
Method Summary | |
---|---|
int | compareTo(Object o1)
Returns an integer indicating the order of this Quarter object relative
to the specified object:
negative == before, zero == same, positive == after.
|
boolean | equals(Object obj)
Tests the equality of this Quarter object to an arbitrary object.
|
long | getFirstMillisecond()
Returns the first millisecond of the quarter. |
long | getFirstMillisecond(Calendar calendar)
Returns the first millisecond in the Quarter, evaluated using the
supplied calendar (which determines the time zone).
|
long | getLastMillisecond()
Returns the last millisecond of the quarter. |
long | getLastMillisecond(Calendar calendar)
Returns the last millisecond of the Quarter, evaluated using the
supplied calendar (which determines the time zone).
|
int | getQuarter()
Returns the quarter.
|
long | getSerialIndex()
Returns a serial index number for the quarter.
|
Year | getYear()
Returns the year.
|
int | getYearValue()
Returns the year.
|
int | hashCode()
Returns a hash code for this object instance. |
RegularTimePeriod | next()
Returns the quarter following this one.
|
static Quarter | parseQuarter(String s)
Parses the string argument as a quarter.
|
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 quarter preceding this one.
|
String | toString()
Returns a string representing the quarter (e.g. |
Parameters: year the year (1900 to 9999). quarter the quarter (1 to 4).
Parameters: quarter the quarter (1 to 4). year the year (1900 to 9999).
Parameters: time the date/time (null
not permitted).
See Also: Quarter
Deprecated: Since 1.0.12, use Quarter instead.
Constructs a Quarter, based on a date/time and time zone.Parameters: time the date/time. zone the zone (null
not permitted).
Quarter
instance, using the specified
zone and locale.
Parameters: time the current time. zone the time zone. locale the locale.
Since: 1.0.12
Parameters: o1 the object to compare
Returns: negative == before, zero == same, positive == after.
true
if the target is a Quarter instance
representing the same quarter as this object. In all other cases,
returns false
.
Parameters: obj the object (null
permitted).
Returns: true
if quarter and year of this and the object are
the same.
Returns: The first millisecond of the quarter.
See Also: getLastMillisecond
Parameters: calendar the calendar (null
not permitted).
Returns: The first millisecond in the Quarter.
Throws: NullPointerException if calendar
is
null
.
Returns: The last millisecond of the quarter.
See Also: getFirstMillisecond
Parameters: calendar the calendar (null
not permitted).
Returns: The last millisecond of the Quarter.
Throws: NullPointerException if calendar
is
null
.
Returns: The quarter.
Returns: The serial index number.
Returns: The year.
Returns: The year.
Since: 1.0.3
http://developer.java.sun.com/developer/Books/effectivejava
/Chapter3.pdf
Returns: A hash code.
Returns: The quarter following this one (or null if this is Q4 9999).
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 (-).
Parameters: s A string representing the quarter.
Returns: The quarter.
Parameters: calendar the calendar (null
not permitted).
Since: 1.0.3
Returns: The quarter preceding this one (or null
if this is
Q1 1900).
Returns: A string representing the quarter.