亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? quarter.java

?? 關于jfreechart的電子說明書,一種說明圖型使用的介紹
?? JAVA
字號:
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 *
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * ------------
 * Quarter.java
 * ------------
 * (C) Copyright 2001-2005, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: Quarter.java,v 1.6.2.2 2005/12/10 20:34:21 mungady Exp $
 *
 * Changes
 * -------
 * 11-Oct-2001 : Version 1 (DG);
 * 18-Dec-2001 : Changed order of parameters in constructor (DG);
 * 19-Dec-2001 : Added a new constructor as suggested by Paul English (DG);
 * 29-Jan-2002 : Added a new method parseQuarter(String) (DG);
 * 14-Feb-2002 : Fixed bug in Quarter(Date) constructor (DG);
 * 26-Feb-2002 : Changed getStart(), getMiddle() and getEnd() methods to 
 *               evaluate with reference to a particular time zone (DG);
 * 19-Mar-2002 : Changed API for TimePeriod classes (DG);
 * 24-Jun-2002 : Removed main method (just test code) (DG);
 * 10-Sep-2002 : Added getSerialIndex() method (DG);
 * 07-Oct-2002 : Fixed errors reported by Checkstyle (DG);
 * 10-Jan-2003 : Changed base class and method names (DG);
 * 13-Mar-2003 : Moved to com.jrefinery.data.time package, and implemented 
 *               Serializable (DG);
 * 21-Oct-2003 : Added hashCode() method (DG);
 * 10-Dec-2005 : Fixed argument checking bug (1377239) in constructor (DG);
 *
 */

package org.jfree.data.time;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

import org.jfree.date.MonthConstants;
import org.jfree.date.SerialDate;

/**
 * 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 
 * {@link RegularTimePeriod} subclasses.
 */
public class Quarter extends RegularTimePeriod implements Serializable {

    /** For serialization. */
    private static final long serialVersionUID = 3810061714380888671L;
    
    /** Constant for quarter 1. */
    public static final int FIRST_QUARTER = 1;

    /** Constant for quarter 4. */
    public static final int LAST_QUARTER = 4;

    /** The first month in each quarter. */
    public static final int[] FIRST_MONTH_IN_QUARTER = {
        0, MonthConstants.JANUARY, MonthConstants.APRIL, MonthConstants.JULY, 
        MonthConstants.OCTOBER
    };

    /** The last month in each quarter. */
    public static final int[] LAST_MONTH_IN_QUARTER = {
        0, MonthConstants.MARCH, MonthConstants.JUNE, MonthConstants.SEPTEMBER, 
        MonthConstants.DECEMBER
    };

    /** The year in which the quarter falls. */
    private Year year;

    /** The quarter (1-4). */
    private int quarter;

    /**
     * Constructs a new Quarter, based on the current system date/time.
     */
    public Quarter() {
        this(new Date());
    }

    /**
     * Constructs a new quarter.
     *
     * @param year  the year (1900 to 9999).
     * @param quarter  the quarter (1 to 4).
     */
    public Quarter(int quarter, int year) {
        this(quarter, new Year(year));
    }

    /**
     * Constructs a new quarter.
     *
     * @param quarter  the quarter (1 to 4).
     * @param year  the year (1900 to 9999).
     */
    public Quarter(int quarter, Year year) {
        if ((quarter < FIRST_QUARTER) || (quarter > LAST_QUARTER)) {
            throw new IllegalArgumentException("Quarter outside valid range.");
        }
        this.year = year;
        this.quarter = quarter;
    }

    /**
     * Constructs a new Quarter, based on a date/time and the default time zone.
     *
     * @param time  the date/time.
     */
    public Quarter(Date time) {
        this(time, RegularTimePeriod.DEFAULT_TIME_ZONE);
    }

    /**
     * Constructs a Quarter, based on a date/time and time zone.
     *
     * @param time  the date/time.
     * @param zone  the zone.
     */
    public Quarter(Date time, TimeZone zone) {

        Calendar calendar = Calendar.getInstance(zone);
        calendar.setTime(time);
        int month = calendar.get(Calendar.MONTH) + 1;
        this.quarter = SerialDate.monthCodeToQuarter(month);
        this.year = new Year(calendar.get(Calendar.YEAR));

    }

    /**
     * Returns the quarter.
     *
     * @return The quarter.
     */
    public int getQuarter() {
        return this.quarter;
    }

    /**
     * Returns the year.
     *
     * @return The year.
     */
    public Year getYear() {
        return this.year;
    }

    /**
     * Returns the quarter preceding this one.
     *
     * @return The quarter preceding this one (or null if this is Q1 1900).
     */
    public RegularTimePeriod previous() {

        Quarter result;
        if (this.quarter > FIRST_QUARTER) {
            result = new Quarter(this.quarter - 1, this.year);
        }
        else {
            Year prevYear = (Year) this.year.previous();
            if (prevYear != null) {
                result = new Quarter(LAST_QUARTER, prevYear);
            }
            else {
                result = null;
            }
        }
        return result;

    }

    /**
     * Returns the quarter following this one.
     *
     * @return The quarter following this one (or null if this is Q4 9999).
     */
    public RegularTimePeriod next() {

        Quarter result;
        if (this.quarter < LAST_QUARTER) {
            result = new Quarter(this.quarter + 1, this.year);
        }
        else {
            Year nextYear = (Year) this.year.next();
            if (nextYear != null) {
                result = new Quarter(FIRST_QUARTER, nextYear);
            }
            else {
                result = null;
            }
        }
        return result;

    }

    /**
     * Returns a serial index number for the quarter.
     *
     * @return The serial index number.
     */
    public long getSerialIndex() {
        return this.year.getYear() * 4L + this.quarter;
    }

    /**
     * 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.
     *
     * @param obj  the object.
     *
     * @return <code>true</code> if quarter and year of this and the object are
     *         the same.
     */
    public boolean equals(Object obj) {

        if (obj != null) {
            if (obj instanceof Quarter) {
                Quarter target = (Quarter) obj;
                return (
                    (this.quarter == target.getQuarter()) 
                    && (this.year.equals(target.getYear()))
                );
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }

    }

    /**
     * Returns a hash code for this object instance.  The approach described by
     * Joshua Bloch in "Effective Java" has been used here:
     * <p>
     * <code>http://developer.java.sun.com/developer/Books/effectivejava
     * /Chapter3.pdf</code>
     * 
     * @return A hash code.
     */
    public int hashCode() {
        int result = 17;
        result = 37 * result + this.quarter;
        result = 37 * result + this.year.hashCode();
        return result;
    }

    /**
     * Returns an integer indicating the order of this Quarter object relative
     * to the specified object:
     *
     * negative == before, zero == same, positive == after.
     *
     * @param o1  the object to compare
     *
     * @return negative == before, zero == same, positive == after.
     */
    public int compareTo(Object o1) {

        int result;

        // CASE 1 : Comparing to another Quarter object
        // --------------------------------------------
        if (o1 instanceof Quarter) {
            Quarter q = (Quarter) o1;
            result = this.year.getYear() - q.getYear().getYear();
            if (result == 0) {
                result = this.quarter - q.getQuarter();
            }
        }

        // CASE 2 : Comparing to another TimePeriod object
        // -----------------------------------------------
        else if (o1 instanceof RegularTimePeriod) {
            // more difficult case - evaluate later...
            result = 0;
        }

        // CASE 3 : Comparing to a non-TimePeriod object
        // ---------------------------------------------
        else {
            // consider time periods to be ordered after general objects
            result = 1;
        }

        return result;

    }

    /**
     * Returns a string representing the quarter (e.g. "Q1/2002").
     *
     * @return A string representing the quarter.
     */
    public String toString() {
        return "Q" + this.quarter + "/" + this.year;
    }

    /**
     * Returns the first millisecond in the Quarter, evaluated using the
     * supplied calendar (which determines the time zone).
     *
     * @param calendar  the calendar.
     *
     * @return The first millisecond in the Quarter.
     */
    public long getFirstMillisecond(Calendar calendar) {

        int month = Quarter.FIRST_MONTH_IN_QUARTER[this.quarter];
        Day first = new Day(1, month, this.year.getYear());
        return first.getFirstMillisecond(calendar);

    }

    /**
     * Returns the last millisecond of the Quarter, evaluated using the
     * supplied calendar (which determines the time zone).
     *
     * @param calendar  the calendar.
     *
     * @return The last millisecond of the Quarter.
     */
    public long getLastMillisecond(Calendar calendar) {

        int month = Quarter.LAST_MONTH_IN_QUARTER[this.quarter];
        int eom = SerialDate.lastDayOfMonth(month, this.year.getYear());
        Day last = new Day(eom, month, this.year.getYear());
        return last.getLastMillisecond(calendar);

    }

    /**
     * Parses the string argument as a quarter.
     * <P>
     * 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 (-).
     * @param s A string representing the quarter.
     *
     * @return The quarter.
     */
    public static Quarter parseQuarter(String s) {

        // find the Q and the integer following it (remove both from the
        // string)...
        int i = s.indexOf("Q");
        if (i == -1) {
            throw new TimePeriodFormatException("Missing Q.");
        }

        if (i == s.length() - 1) {
            throw new TimePeriodFormatException("Q found at end of string.");
        }

        String qstr = s.substring(i + 1, i + 2);
        int quarter = Integer.parseInt(qstr);
        String remaining = s.substring(0, i) + s.substring(i + 2, s.length());

        // replace any / , or - with a space
        remaining = remaining.replace('/', ' ');
        remaining = remaining.replace(',', ' ');
        remaining = remaining.replace('-', ' ');

        // parse the string...
        Year year = Year.parseYear(remaining.trim());
        Quarter result = new Quarter(quarter, year);
        return result;

    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产综合一区二区| 中文字幕一区二区三区在线不卡| 精品国产乱子伦一区| 亚洲欧美影音先锋| 国产一区中文字幕| 欧美日韩视频在线一区二区| 国产精品入口麻豆九色| 久草在线在线精品观看| 欧美日韩高清在线| 亚洲精品免费在线观看| 国产成人免费视| 精品美女一区二区三区| 日韩和欧美一区二区| 欧美亚洲丝袜传媒另类| 亚洲欧美中日韩| 国产91在线看| 26uuu久久天堂性欧美| 日韩高清不卡一区| 欧美日韩情趣电影| 亚洲国产欧美日韩另类综合| 菠萝蜜视频在线观看一区| 久久久国际精品| 激情综合色播激情啊| 日韩一区二区三区电影| 天天亚洲美女在线视频| 欧美人体做爰大胆视频| 亚洲第一电影网| 欧美日韩亚洲综合一区| 日韩成人免费在线| 91精品国产色综合久久不卡电影| 亚洲第一av色| 日韩一二三四区| 精品一区二区三区视频| 欧美精品一区二区三| 国产乱码字幕精品高清av| 久久综合久久99| 国产黄人亚洲片| 欧美激情在线一区二区| 播五月开心婷婷综合| 亚洲欧美日韩在线不卡| 欧美在线一二三四区| 午夜国产精品一区| 91精品福利在线一区二区三区| 全国精品久久少妇| 精品国产一区二区国模嫣然| 国产又黄又大久久| 国产欧美日韩综合精品一区二区| 成人av高清在线| 夜夜嗨av一区二区三区| 欧美一区二区三区在线看| 久久9热精品视频| 国产欧美精品一区二区色综合朱莉| av在线不卡电影| 亚洲成av人片在www色猫咪| 欧美一区欧美二区| 国产成人超碰人人澡人人澡| 亚洲日本va午夜在线电影| 欧美日韩久久久| 韩国av一区二区三区四区| 中文字幕不卡在线观看| 欧美亚洲禁片免费| 日韩激情中文字幕| 国产婷婷色一区二区三区 | 国产在线精品一区二区夜色| 日本一区二区三区在线观看| 欧洲一区二区三区在线| 韩国av一区二区三区四区| 亚洲精品中文在线影院| 欧美一区二区视频观看视频| caoporn国产精品| 蜜桃视频在线一区| 国产精品久久久久国产精品日日| 在线成人高清不卡| 成人午夜视频在线| 久久精品国产精品青草| 亚洲免费毛片网站| 久久久久久久久久久黄色| 91国偷自产一区二区开放时间| 久久se精品一区二区| 亚洲网友自拍偷拍| 国产精品免费网站在线观看| 日韩视频不卡中文| 精品视频免费在线| 成人av高清在线| 精品一区二区免费看| 亚洲成人资源网| 自拍偷自拍亚洲精品播放| 欧美成人bangbros| 欧美日韩午夜在线视频| 91麻豆高清视频| 国产99久久久久| 久久国产尿小便嘘嘘| 午夜av区久久| 一个色在线综合| 自拍偷拍亚洲欧美日韩| 欧美国产精品久久| 欧美精品一区二区蜜臀亚洲| 日韩一卡二卡三卡四卡| 欧美日本在线视频| 欧美在线观看视频在线| 99re视频这里只有精品| 盗摄精品av一区二区三区| 狠狠久久亚洲欧美| 久久精品99国产精品| 日本欧美久久久久免费播放网| 亚洲一区自拍偷拍| 依依成人综合视频| 夜夜精品视频一区二区| 一区二区高清免费观看影视大全| 亚洲精品成人悠悠色影视| 综合色天天鬼久久鬼色| 自拍偷拍国产精品| 亚洲欧洲在线观看av| 亚洲欧洲日韩一区二区三区| 国产精品每日更新| 综合自拍亚洲综合图不卡区| 亚洲欧美乱综合| 亚洲激情成人在线| 亚洲午夜av在线| 日本在线不卡视频一二三区| 蜜臀av性久久久久av蜜臀妖精| 日韩av电影免费观看高清完整版| 日韩精品一级中文字幕精品视频免费观看 | 国产成人免费视| www.欧美亚洲| 色悠悠久久综合| 欧美日韩精品免费| 日韩欧美国产1| 精品国产乱子伦一区| 国产精品三级电影| 亚洲午夜一区二区| 另类成人小视频在线| 高清视频一区二区| 91在线porny国产在线看| 色噜噜狠狠成人中文综合| 欧美午夜精品理论片a级按摩| 这里只有精品99re| 精品国产91洋老外米糕| 国产精品国产自产拍高清av王其| 亚洲欧美电影院| 奇米影视一区二区三区| 国产乱码精品一区二区三区av| 不卡高清视频专区| 91精品国产美女浴室洗澡无遮挡| 久久综合久久综合久久综合| 1区2区3区欧美| 日韩国产高清影视| 粉嫩av一区二区三区| 欧美色老头old∨ideo| 精品乱人伦一区二区三区| 中文字幕一区二区三区四区不卡| 午夜日韩在线电影| 国产一区二区视频在线| 在线看国产一区二区| 亚洲精品一区二区三区蜜桃下载| 亚洲少妇30p| 精品一区二区影视| 欧美最新大片在线看| 久久久久一区二区三区四区| 亚洲欧美成aⅴ人在线观看| 久久99精品久久久久久久久久久久 | 欧美一区二区三区思思人| 中文字幕一区二区三区乱码在线 | 成人国产精品免费观看| 欧美日韩一区二区欧美激情| 久久久不卡影院| 天天综合色天天| 一本色道a无线码一区v| 久久久精品人体av艺术| 免费在线观看精品| 欧美中文字幕亚洲一区二区va在线| 久久久综合视频| 奇米在线7777在线精品| 欧美日韩在线观看一区二区 | 99国产精品久久| www久久精品| 欧美96一区二区免费视频| 在线视频你懂得一区| 欧美国产禁国产网站cc| 黄色小说综合网站| 91精品国产综合久久精品性色| 亚洲激情综合网| 91丝袜高跟美女视频| 欧美激情综合网| 国产福利一区二区三区视频| 欧美成人一区二区| 日本在线不卡一区| 91精品国产综合久久福利| 亚洲午夜一二三区视频| 欧美性xxxxx极品少妇| 亚洲免费在线视频一区 二区| 成人黄色综合网站| 国产精品免费看片| 成人黄色片在线观看| 国产精品私人自拍| jiyouzz国产精品久久| 国产精品毛片大码女人| 99在线精品视频| 亚洲色图另类专区| 欧美中文字幕亚洲一区二区va在线|