Example usage for org.jfree.chart.date SerialDate monthCodeToQuarter

List of usage examples for org.jfree.chart.date SerialDate monthCodeToQuarter

Introduction

In this page you can find the example usage for org.jfree.chart.date SerialDate monthCodeToQuarter.

Prototype

public static int monthCodeToQuarter(final int code) 

Source Link

Document

Returns the quarter for the specified month.

Usage

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

/**
 * Creates a new <code>Quarter</code> instance, using the specified
 * zone and locale./* w  w  w .  j  a va  2s.c o m*/
 *
 * @param time  the current time.
 * @param zone  the time zone.
 * @param locale  the locale.
 *
 * @since 1.0.12
 */
public Quarter(Date time, TimeZone zone, Locale locale) {
    Calendar calendar = Calendar.getInstance(zone, locale);
    calendar.setTime(time);
    int month = calendar.get(Calendar.MONTH) + 1;
    this.quarter = (byte) SerialDate.monthCodeToQuarter(month);
    this.year = (short) calendar.get(Calendar.YEAR);
    peg(calendar);
}