本文整理汇总了Java中org.jfree.date.SerialDate.monthCodeToQuarter方法的典型用法代码示例。如果您正苦于以下问题:Java SerialDate.monthCodeToQuarter方法的具体用法?Java SerialDate.monthCodeToQuarter怎么用?Java SerialDate.monthCodeToQuarter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.date.SerialDate
的用法示例。
在下文中一共展示了SerialDate.monthCodeToQuarter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Quarter
import org.jfree.date.SerialDate; //导入方法依赖的package包/类
/**
* Constructs a Quarter, based on a date/time and time zone.
*
* @param time the date/time.
* @param zone the zone.
*/
public Quarter(final Date time, final TimeZone zone) {
final Calendar calendar = Calendar.getInstance(zone);
calendar.setTime(time);
final int month = calendar.get(Calendar.MONTH) + 1;
this.quarter = SerialDate.monthCodeToQuarter(month);
this.year = new Year(calendar.get(Calendar.YEAR));
}
示例2: Quarter
import org.jfree.date.SerialDate; //导入方法依赖的package包/类
/**
* Constructs a Quarter, based on a date/time and time zone.
*
* @param time the date/time.
* @param zone the zone (<code>null</code> not permitted).
*/
public Quarter(Date time, TimeZone zone) {
Calendar calendar = Calendar.getInstance(zone);
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);
}
示例3: Quarter
import org.jfree.date.SerialDate; //导入方法依赖的package包/类
/**
* Constructs a Quarter, based on a date/time and time zone.
*
* @param time the date/time.
* @param zone the zone (<code>null</code> not permitted).
*/
public Quarter(Date time, TimeZone zone) {
// FIXME: need a locale as well as a timezone
Calendar calendar = Calendar.getInstance(zone);
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);
}
示例4: Quarter
import org.jfree.date.SerialDate; //导入方法依赖的package包/类
/**
* Creates a new <code>Quarter</code> instance, using the specified
* zone and locale.
*
* @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);
}