Example usage for org.jfree.data.time Quarter LAST_MONTH_IN_QUARTER

List of usage examples for org.jfree.data.time Quarter LAST_MONTH_IN_QUARTER

Introduction

In this page you can find the example usage for org.jfree.data.time Quarter LAST_MONTH_IN_QUARTER.

Prototype

null LAST_MONTH_IN_QUARTER

To view the source code for org.jfree.data.time Quarter LAST_MONTH_IN_QUARTER.

Click Source Link

Document

The last month in each quarter.

Usage

From source file:org.jfree.data.time.Quarter.java

/**
 * Returns the last millisecond of the Quarter, evaluated using the
 * supplied calendar (which determines the time zone).
 *
 * @param calendar  the calendar (<code>null</code> not permitted).
 *
 * @return The last millisecond of the Quarter.
 *
 * @throws NullPointerException if {@code calendar} is {@code null}.
 *//*from   ww  w  .j  av a 2 s.  co  m*/
@Override
public long getLastMillisecond(Calendar calendar) {
    int month = Quarter.LAST_MONTH_IN_QUARTER[this.quarter];
    int eom = SerialDate.lastDayOfMonth(month, this.year);
    calendar.set(this.year, month - 1, eom, 23, 59, 59);
    calendar.set(Calendar.MILLISECOND, 999);
    return calendar.getTimeInMillis();
}