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

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

?? day.java

?? jfreechart1.0.1 jsp繪制圖表的開發包
?? 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.]
 *
 * --------
 * Day.java
 * --------
 * (C) Copyright 2001-2004, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: Day.java,v 1.7.2.1 2005/10/25 21:35:24 mungady Exp $
 *
 * Changes
 * -------
 * 11-Oct-2001 : Version 1 (DG);
 * 15-Nov-2001 : Updated Javadoc comments (DG);
 * 04-Dec-2001 : Added static method to parse a string into a Day object (DG);
 * 19-Dec-2001 : Added new constructor as suggested by Paul English (DG);
 * 29-Jan-2002 : Changed getDay() method to getSerialDate() (DG);
 * 26-Feb-2002 : Changed getStart(), getMiddle() and getEnd() methods to 
 *               evaluate with reference to a particular time zone (DG);
 * 19-Mar-2002 : Changed the API for the TimePeriod classes (DG);
 * 29-May-2002 : Fixed bug in equals method (DG);
 * 24-Jun-2002 : Removed unnecessary imports (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);
 * 30-Sep-2004 : Replaced getTime().getTime() with getTimeInMillis() (DG);
 * 04-Nov-2004 : Reverted change of 30-Sep-2004, because it won't work for 
 *               JDK 1.3 (DG);
 * 
 */

package org.jfree.data.time;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

import org.jfree.date.SerialDate;

/**
 * Represents a single day in the range 1-Jan-1900 to 31-Dec-9999.  This class 
 * is immutable, which is a requirement for all {@link RegularTimePeriod} 
 * subclasses.
 */
public class Day extends RegularTimePeriod implements Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -7082667380758962755L;
    
    /** A standard date formatter. */
    protected static final DateFormat DATE_FORMAT 
        = new SimpleDateFormat("yyyy-MM-dd");

    /** A date formatter for the default locale. */
    protected static final DateFormat
        DATE_FORMAT_SHORT = DateFormat.getDateInstance(DateFormat.SHORT);

    /** A date formatter for the default locale. */
    protected static final DateFormat
        DATE_FORMAT_MEDIUM = DateFormat.getDateInstance(DateFormat.MEDIUM);

    /** A date formatter for the default locale. */
    protected static final DateFormat
        DATE_FORMAT_LONG = DateFormat.getDateInstance(DateFormat.LONG);

    /** The day (uses SerialDate for convenience). */
    private SerialDate serialDate;

    /**
     * Creates a new instance, derived from the system date/time (and assuming 
     * the default timezone).
     */
    public Day() {
        this(new Date());
    }

    /**
     * Constructs a new one day time period.
     *
     * @param day  the day-of-the-month.
     * @param month  the month (1 to 12).
     * @param year  the year (1900 <= year <= 9999).
     */
    public Day(int day, int month, int year) {
        this.serialDate = SerialDate.createInstance(day, month, year);
    }

    /**
     * Constructs a new one day time period.
     *
     * @param serialDate  the day (<code>null</code> not permitted).
     */
    public Day(SerialDate serialDate) {
        if (serialDate == null) {
            throw new IllegalArgumentException("Null 'serialDate' argument.");
        }
        this.serialDate = serialDate;
    }

    /**
     * Constructs a new instance, based on a particular date/time and the 
     * default time zone.
     *
     * @param time  the time (<code>null</code> not permitted).
     */
    public Day(Date time) {
        // defer argument checking...
        this(time, RegularTimePeriod.DEFAULT_TIME_ZONE);
    }

    /**
     * Constructs a new instance, based on a particular date/time and time zone.
     *
     * @param time  the date/time.
     * @param zone  the time zone.
     */
    public Day(Date time, TimeZone zone) {
        if (time == null) {
            throw new IllegalArgumentException("Null 'time' argument.");
        }
        if (zone == null) {
            throw new IllegalArgumentException("Null 'zone' argument.");
        }
        Calendar calendar = Calendar.getInstance(zone);
        calendar.setTime(time);
        int d = calendar.get(Calendar.DAY_OF_MONTH);
        int m = calendar.get(Calendar.MONTH) + 1;
        int y = calendar.get(Calendar.YEAR);
        this.serialDate = SerialDate.createInstance(d, m, y);
    }

    /**
     * Returns the day as a {@link SerialDate}.  Note: the reference that is 
     * returned should be an instance of an immutable {@link SerialDate} 
     * (otherwise the caller could use the reference to alter the state of 
     * this <code>Day</code> instance, and <code>Day</code> is supposed
     * to be immutable).
     *
     * @return The day as a {@link SerialDate}.
     */
    public SerialDate getSerialDate() {
        return this.serialDate;
    }

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

    /**
     * Returns the month.
     *
     * @return The month.
     */
    public int getMonth() {
        return this.serialDate.getMonth();
    }

    /**
     * Returns the day of the month.
     *
     * @return The day of the month.
     */
    public int getDayOfMonth() {
        return this.serialDate.getDayOfMonth();
    }

    /**
     * Returns the day preceding this one.
     *
     * @return The day preceding this one.
     */
    public RegularTimePeriod previous() {

        Day result;
        int serial = this.serialDate.toSerial();
        if (serial > SerialDate.SERIAL_LOWER_BOUND) {
            SerialDate yesterday = SerialDate.createInstance(serial - 1);
            return new Day(yesterday);
        }
        else {
            result = null;
        }
        return result;

    }

    /**
     * Returns the day following this one, or <code>null</code> if some limit 
     * has been reached.
     *
     * @return The day following this one, or <code>null</code> if some limit 
     *         has been reached.
     */
    public RegularTimePeriod next() {

        Day result;
        int serial = this.serialDate.toSerial();
        if (serial < SerialDate.SERIAL_UPPER_BOUND) {
            SerialDate tomorrow = SerialDate.createInstance(serial + 1);
            return new Day(tomorrow);
        }
        else {
            result = null;
        }
        return result;

    }

    /**
     * Returns a serial index number for the day.
     *
     * @return The serial index number.
     */
    public long getSerialIndex() {
        return this.serialDate.toSerial();
    }

    /**
     * Returns the first millisecond of the day, evaluated using the supplied
     * calendar (which determines the time zone).
     *
     * @param calendar  calendar to use.
     *
     * @return The start of the day as milliseconds since 01-01-1970.
     */
    public long getFirstMillisecond(Calendar calendar) {

        int year = this.serialDate.getYYYY();
        int month = this.serialDate.getMonth();
        int day = this.serialDate.getDayOfMonth();
        calendar.clear();
        calendar.set(year, month - 1, day, 0, 0, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        //return calendar.getTimeInMillis();  // this won't work for JDK 1.3
        return calendar.getTime().getTime();

    }

    /**
     * Returns the last millisecond of the day, evaluated using the supplied
     * calendar (which determines the time zone).
     *
     * @param calendar  calendar to use.
     *
     * @return The end of the day as milliseconds since 01-01-1970.
     */
    public long getLastMillisecond(Calendar calendar) {

        int year = this.serialDate.getYYYY();
        int month = this.serialDate.getMonth();
        int day = this.serialDate.getDayOfMonth();
        calendar.clear();
        calendar.set(year, month - 1, day, 23, 59, 59);
        calendar.set(Calendar.MILLISECOND, 999);
        //return calendar.getTimeInMillis();  // this won't work for JDK 1.3
        return calendar.getTime().getTime();

    }

    /**
     * Tests the equality of this Day object to an arbitrary object.  Returns
     * true if the target is a Day instance or a SerialDate instance
     * representing the same day as this object. In all other cases,
     * returns false.
     *
     * @param obj  the object.
     *
     * @return A flag indicating whether or not an object is equal to this day.
     */
    public boolean equals(Object obj) {
        
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Day)) {
            return false;
        }
        Day that = (Day) obj;
        if (!this.serialDate.equals(that.getSerialDate())) {
            return false;
        }
        return true;
        
    }

    /**
     * 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() {
        return this.serialDate.hashCode();
    }

    /**
     * Returns an integer indicating the order of this Day 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 Day object
        // ----------------------------------------
        if (o1 instanceof Day) {
            Day d = (Day) o1;
            result = -d.getSerialDate().compare(this.serialDate);
        }

        // 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 day.
     *
     * @return A string representing the day.
     */
    public String toString() {
        return this.serialDate.toString();
    }

    /**
     * Parses the string argument as a day.
     * <P>
     * This method is required to recognise YYYY-MM-DD as a valid format.
     * Anything else, for now, is a bonus.
     *
     * @param s  the date string to parse.
     *
     * @return <code>null</code> if the string does not contain any parseable
     *      string, the day otherwise.
     */
    public static Day parseDay(String s) {

        try {
            return new Day (Day.DATE_FORMAT.parse(s));
        }
        catch (ParseException e1) {
            try {
                return new Day (Day.DATE_FORMAT_SHORT.parse(s));
            }
            catch (ParseException e2) {
              // ignore
            }
        }
        return null;

    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久欧美精品sm网站| 欧美中文字幕一区二区三区亚洲| 日韩欧美一二三| 免费观看在线综合| 欧美精品一区二区三区在线播放| 国产一区二区三区四区五区入口| 久久久亚洲高清| 99久久精品99国产精品| 亚洲卡通欧美制服中文| 欧美手机在线视频| 秋霞av亚洲一区二区三| 精品国产免费人成电影在线观看四季 | 91精品欧美综合在线观看最新| 日韩精品电影一区亚洲| 精品少妇一区二区| 成人黄色网址在线观看| 亚洲精品写真福利| 91精品国产一区二区三区蜜臀| 国产一区二区在线免费观看| 国产精品人成在线观看免费| 色婷婷亚洲综合| 久久国产尿小便嘘嘘| 国产精品久久777777| 色婷婷激情综合| 久久99在线观看| 亚洲欧洲一区二区在线播放| 欧美三区在线观看| 国产精品一区一区三区| 亚洲一区二区三区激情| 精品国产乱码久久久久久浪潮 | 爽好多水快深点欧美视频| 日韩亚洲国产中文字幕欧美| 99久久伊人久久99| 日本欧美大码aⅴ在线播放| 亚洲国产精品传媒在线观看| 欧美日韩视频在线第一区| 国产一区不卡视频| 亚洲地区一二三色| 国产精品成人免费在线| 日韩一级片网址| 色天天综合久久久久综合片| 国内精品伊人久久久久av影院| 亚洲另类在线制服丝袜| 国产亚洲欧美日韩俺去了| 欧美午夜精品免费| 岛国精品在线观看| 看片的网站亚洲| 午夜视频在线观看一区二区| 中文字幕第一区第二区| 欧美成人精精品一区二区频| 欧美色精品在线视频| 91毛片在线观看| 成人毛片在线观看| 久久国产生活片100| 日韩精品一二三区| 亚洲一区二区三区中文字幕在线| 国产三级精品三级在线专区| 91精品国产一区二区| 在线观看免费成人| 91原创在线视频| 菠萝蜜视频在线观看一区| 精品一区二区国语对白| 石原莉奈在线亚洲三区| 亚洲精品成a人| 国产精品夫妻自拍| 中文字幕乱码亚洲精品一区| 精品国产乱码久久久久久牛牛 | 色哟哟国产精品| 丰满亚洲少妇av| 国产麻豆成人精品| 国内精品国产三级国产a久久| 免费高清不卡av| 日韩国产精品久久| 免费观看日韩av| 激情综合亚洲精品| 精品一区免费av| 国产米奇在线777精品观看| 久久国产综合精品| 极品少妇一区二区| 国产精品白丝jk黑袜喷水| 国产精品一区在线观看你懂的| 国产一二精品视频| 丁香五精品蜜臀久久久久99网站| 成人午夜激情片| 91天堂素人约啪| 91福利区一区二区三区| 在线免费观看视频一区| 欧美日韩国产综合一区二区三区| 欧美三级视频在线| 91精品国产一区二区三区| 日韩精品一区二区三区在线| 精品国产91洋老外米糕| 欧美精品一区二区三| 久久久精品天堂| 国产精品亲子乱子伦xxxx裸| 亚洲欧美日韩国产另类专区| 亚洲精品va在线观看| 三级成人在线视频| 国内精品在线播放| 99精品久久久久久| 欧美日韩一区在线观看| 日韩亚洲欧美高清| 欧美国产亚洲另类动漫| 亚洲免费av观看| 日产国产欧美视频一区精品| 精品中文字幕一区二区| 成人黄色在线网站| 精品视频1区2区3区| 精品免费一区二区三区| 亚洲欧美在线aaa| 亚洲成av人片一区二区梦乃| 国产一区美女在线| 日本电影亚洲天堂一区| 日韩精品一区在线| 亚洲视频综合在线| 精品一区二区三区在线播放| 成人高清视频免费观看| 91麻豆精品国产综合久久久久久| 欧美精品一区二区三区一线天视频 | 美女精品一区二区| 99久久精品国产网站| 欧美一区二区在线不卡| 亚洲国产成人自拍| 日日夜夜精品视频免费| 成人亚洲一区二区一| 91精品国产综合久久精品app| 中文字幕欧美激情| 日韩精品一二三四| 91视视频在线直接观看在线看网页在线看 | 亚洲成av人片一区二区梦乃| 国产经典欧美精品| 在线播放/欧美激情| 国产精品久久国产精麻豆99网站| 毛片av一区二区| 欧美亚洲禁片免费| 国产精品嫩草99a| 韩国av一区二区三区四区| 精品视频一区三区九区| 综合欧美亚洲日本| 国产在线精品一区二区夜色| 欧美日韩在线观看一区二区| 国产精品麻豆久久久| 看电影不卡的网站| 欧美精选一区二区| 亚洲日本欧美天堂| 成人高清伦理免费影院在线观看| 欧美电视剧在线观看完整版| 午夜视频一区在线观看| 一本大道久久a久久综合婷婷| 国产视频一区二区三区在线观看| 日本中文字幕不卡| 欧美日韩国产综合一区二区 | 韩国女主播一区| 欧美一激情一区二区三区| 亚洲精品自拍动漫在线| 成人av免费在线| 日本一区二区视频在线观看| 精品在线观看视频| 欧美一区二区视频观看视频 | 中文字幕在线不卡视频| 国产精品一区免费视频| 日韩一区二区免费高清| 日韩高清在线一区| 3atv一区二区三区| 视频一区在线播放| 91精品国产欧美一区二区18 | 黄页网站大全一区二区| 日韩一区二区免费视频| 免费的国产精品| 欧美成人性福生活免费看| 久久精品国产久精国产爱| 精品美女一区二区| 精品午夜久久福利影院| 欧美一级国产精品| 久久99精品久久久久婷婷| 日韩精品一区二| 韩国毛片一区二区三区| 久久久精品综合| 北条麻妃国产九九精品视频| 国产精品污网站| 91在线一区二区三区| 亚洲免费在线视频一区 二区| 91国产精品成人| 日韩不卡手机在线v区| 欧美成人官网二区| 国产精品99久久久久| 国产精品网友自拍| 一本久道中文字幕精品亚洲嫩| 亚洲乱码精品一二三四区日韩在线| 色综合色综合色综合色综合色综合 | 91久久免费观看| 亚洲国产欧美另类丝袜| 欧美va天堂va视频va在线| 国产精品18久久久久久久久久久久 | 亚洲影视在线播放| 欧美一区二区三区免费大片| 九九**精品视频免费播放| 国产精品久久久99| 欧美日韩国产不卡| 韩国午夜理伦三级不卡影院|