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

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

?? hour.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.]
 *
 * ---------
 * Hour.java
 * ---------
 * (C) Copyright 2001-2004, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: Hour.java,v 1.5.2.1 2005/10/25 21:35:24 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);
 * 14-Feb-2002 : Fixed bug in Hour(Date) constructor (DG);
 * 26-Feb-2002 : Changed getStart(), getMiddle() and getEnd() methods to 
 *               evaluate with reference to a particular time zone (DG);
 * 15-Mar-2002 : Changed API (DG);
 * 16-Apr-2002 : Fixed small time zone bug in constructor (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, and new constructor for 
 *               convenience (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.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

/**
 * Represents an hour in a specific day.  This class is immutable, which is a 
 * requirement for all {@link RegularTimePeriod} subclasses.
 */
public class Hour extends RegularTimePeriod implements Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -835471579831937652L;
    
    /** Useful constant for the first hour in the day. */
    public static final int FIRST_HOUR_IN_DAY = 0;

    /** Useful constant for the last hour in the day. */
    public static final int LAST_HOUR_IN_DAY = 23;

    /** The day. */
    private Day day;

    /** The hour. */
    private int hour;

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

    /**
     * Constructs a new Hour.
     *
     * @param hour  the hour (in the range 0 to 23).
     * @param day  the day (<code>null</code> not permitted).
     */
    public Hour(int hour, Day day) {
        if (day == null) {
            throw new IllegalArgumentException("Null 'day' argument.");
        }
        this.hour = hour;
        this.day = day;
    }

    /**
     * Creates a new hour.
     * 
     * @param hour  the hour (0-23).
     * @param day  the day (1-31).
     * @param month  the month (1-12).
     * @param year  the year (1900-9999).
     */
    public Hour(int hour, int day, int month, int year) {
        this(hour, new Day(day, month, year));
    }
    
    /**
     * Constructs a new Hour, based on the supplied date/time.
     *
     * @param time  the date-time (<code>null</code> not permitted).
     */
    public Hour(Date time) {
        // defer argument checking...
        this(time, RegularTimePeriod.DEFAULT_TIME_ZONE);
    }

    /**
     * Constructs a new Hour, based on the supplied date/time evaluated in the
     * specified time zone.
     *
     * @param time  the date-time (<code>null</code> not permitted).
     * @param zone  the time zone (<code>null</code> not permitted).
     */
    public Hour(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);
        this.hour = calendar.get(Calendar.HOUR_OF_DAY);
        this.day = new Day(time, zone);
    }

    /**
     * Returns the hour.
     *
     * @return The hour (0 <= hour <= 23).
     */
    public int getHour() {
        return this.hour;
    }

    /**
     * Returns the day in which this hour falls.
     *
     * @return The day.
     */
    public Day getDay() {
        return this.day;
    }

    /**
     * Returns the year in which this hour falls.
     *
     * @return The year.
     */
    public int getYear() {
        return this.day.getYear();
    }

    /**
     * Returns the month in which this hour falls.
     *
     * @return The month.
     */
    public int getMonth() {
        return this.day.getMonth();
    }

    /**
     * Returns the day-of-the-month in which this hour falls.
     *
     * @return The day-of-the-month.
     */
    public int getDayOfMonth() {
        return this.day.getDayOfMonth();
    }

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

        Hour result;
        if (this.hour != FIRST_HOUR_IN_DAY) {
            result = new Hour(this.hour - 1, this.day);
        }
        else { // we are at the first hour in the day...
            Day prevDay = (Day) this.day.previous();
            if (prevDay != null) {
                result = new Hour(LAST_HOUR_IN_DAY, prevDay);
            }
            else {
                result = null;
            }
        }
        return result;

    }

    /**
     * Returns the hour following this one.
     *
     * @return The hour following this one.
     */
    public RegularTimePeriod next() {

        Hour result;
        if (this.hour != LAST_HOUR_IN_DAY) {
            result = new Hour(this.hour + 1, this.day);
        }
        else { // we are at the last hour in the day...
            Day nextDay = (Day) this.day.next();
            if (nextDay != null) {
                result = new Hour(FIRST_HOUR_IN_DAY, nextDay);
            }
            else {
                result = null;
            }
        }
        return result;

    }

    /**
     * Returns a serial index number for the hour.
     *
     * @return The serial index number.
     */
    public long getSerialIndex() {
        return this.day.getSerialIndex() * 24L + this.hour;
    }

    /**
     * Returns the first millisecond of the hour.
     *
     * @param calendar  the calendar/timezone.
     *
     * @return The first millisecond.
     */
    public long getFirstMillisecond(Calendar calendar) {

        int year = this.day.getYear();
        int month = this.day.getMonth() - 1;
        int dom = this.day.getDayOfMonth();

        calendar.set(year, month, dom, this.hour, 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 hour.
     *
     * @param calendar  the calendar/timezone.
     *
     * @return The last millisecond.
     */
    public long getLastMillisecond(Calendar calendar) {

        int year = this.day.getYear();
        int month = this.day.getMonth() - 1;
        int dom = this.day.getDayOfMonth();

        calendar.set(year, month, dom, this.hour, 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 object against an arbitrary Object.
     * <P>
     * This method will return true ONLY if the object is an Hour object
     * representing the same hour as this instance.
     *
     * @param obj  the object to compare (<code>null</code> permitted).
     *
     * @return <code>true</code> if the hour and day value of the object
     *      is the same as this.
     */
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Hour)) {
            return false;
        }
        Hour that = (Hour) obj;
        if (this.hour != that.hour) {
            return false;
        }
        if (!this.day.equals(that.day)) {
            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() {
        int result = 17;
        result = 37 * result + this.hour;
        result = 37 * result + this.day.hashCode();
        return result;
    }

    /**
     * Returns an integer indicating the order of this Hour 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 Hour object
        // -----------------------------------------
        if (o1 instanceof Hour) {
            Hour h = (Hour) o1;
            result = getDay().compareTo(h.getDay());
            if (result == 0) {
                result = this.hour - h.getHour();
            }
        }

        // 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;

    }

    /**
     * Creates an Hour instance by parsing a string.  The string is assumed to
     * be in the format "YYYY-MM-DD HH", perhaps with leading or trailing
     * whitespace.
     *
     * @param s  the hour string to parse.
     *
     * @return <code>null</code> if the string is not parseable, the hour 
     *         otherwise.
     */
    public static Hour parseHour(String s) {

        Hour result = null;
        s = s.trim();

        String daystr = s.substring(0, Math.min(10, s.length()));
        Day day = Day.parseDay(daystr);
        if (day != null) {
            String hourstr = s.substring(
                Math.min(daystr.length() + 1, s.length()), s.length()
            );
            hourstr = hourstr.trim();
            int hour = Integer.parseInt(hourstr);
            // if the hour is 0 - 23 then create an hour
            if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) {
                result = new Hour(hour, day);
            }
        }

        return result;

    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产高清久久伦理二区| 亚洲女爱视频在线| 欧洲精品一区二区| 国产成人午夜99999| 天堂一区二区在线| 国产精品不卡在线观看| 日韩三级高清在线| 欧美美女bb生活片| 91亚洲永久精品| 国产a久久麻豆| 久久99精品久久久久久| 亚洲成a人片在线不卡一二三区| 亚洲欧洲日韩综合一区二区| 26uuu欧美| 91 com成人网| 欧美日韩五月天| 色菇凉天天综合网| jvid福利写真一区二区三区| 国产精品自在在线| 久久99国产精品麻豆| 午夜精品久久久久久久久久久| 亚洲色图欧美在线| 中文字幕一区二区三区色视频| 久久久亚洲国产美女国产盗摄 | 中文字幕色av一区二区三区| 精品国产污污免费网站入口 | 国产午夜精品久久久久久久| 日韩精品一区二区三区蜜臀| 欧美疯狂做受xxxx富婆| 在线观看网站黄不卡| 色欧美片视频在线观看| 一本大道av一区二区在线播放| 波多野结衣亚洲| av亚洲精华国产精华| 成人白浆超碰人人人人| 成人爱爱电影网址| 欧美韩国日本不卡| 中日韩av电影| 国产精品国产精品国产专区不蜜| 中文欧美字幕免费| 国产精品丝袜一区| 国产精品久久久久久一区二区三区| 中文字幕一区日韩精品欧美| 亚洲欧美综合色| 亚洲另类在线制服丝袜| 亚洲综合久久久久| 日韩高清不卡在线| 麻豆成人免费电影| 国产一区二区在线观看免费| 国产高清成人在线| 99麻豆久久久国产精品免费 | 一本到一区二区三区| 欧美主播一区二区三区| 欧美精品久久久久久久多人混战 | 日韩视频免费观看高清完整版| 日韩一区二区三区精品视频| 久久久久久麻豆| 一区在线中文字幕| 午夜欧美电影在线观看| 狠狠狠色丁香婷婷综合久久五月| 国产成人亚洲综合a∨婷婷图片| 国产成人在线免费| 色综合天天做天天爱| 精品1区2区3区| 久久综合九色欧美综合狠狠| 国产精品久久久久久久浪潮网站| 中文字幕一区二区三区在线观看| 一区二区欧美在线观看| 日韩精品一二三| 国产精品69毛片高清亚洲| 91丨porny丨最新| 欧美丰满嫩嫩电影| 久久中文字幕电影| 樱花影视一区二区| 伦理电影国产精品| 99精品视频一区二区| 欧美精品在线一区二区三区| 国产欧美精品一区二区三区四区| 亚洲自拍欧美精品| 国产精品一区二区不卡| 色94色欧美sute亚洲13| 久久综合色综合88| 一卡二卡欧美日韩| 国内成人自拍视频| 在线亚洲一区二区| 久久久久久久久久久久电影| 亚洲最大成人综合| 国内国产精品久久| 欧美日韩国产综合久久| 国产精品久久久久影院老司| 日欧美一区二区| eeuss鲁片一区二区三区| 欧美一区二区三区婷婷月色| 国产精品麻豆99久久久久久| 日本在线不卡视频| 99久久久免费精品国产一区二区| 美女视频一区在线观看| 一本在线高清不卡dvd| 久久久五月婷婷| 青青草国产精品97视觉盛宴 | 91色porny蝌蚪| 久久久久久一二三区| 午夜在线成人av| caoporen国产精品视频| 精品国产一区二区三区忘忧草 | 91视频免费看| ww亚洲ww在线观看国产| 婷婷夜色潮精品综合在线| 99精品国产一区二区三区不卡| 精品国产91亚洲一区二区三区婷婷| 亚洲第一精品在线| 在线观看中文字幕不卡| 亚洲欧洲精品一区二区三区| 国产一区二区视频在线| 宅男在线国产精品| 亚洲在线中文字幕| 91久久人澡人人添人人爽欧美| 国产精品麻豆99久久久久久| 高清国产一区二区三区| 精品精品欲导航| 美国十次综合导航| 欧美一级视频精品观看| 婷婷成人激情在线网| 欧美精品视频www在线观看| 亚洲精品福利视频网站| av不卡免费在线观看| 欧美极品另类videosde| 国产成人高清在线| 中文无字幕一区二区三区 | 成人美女视频在线看| 久久精品亚洲麻豆av一区二区| 激情综合色综合久久综合| 欧美va在线播放| 韩日av一区二区| 国产亚洲欧美日韩在线一区| 国产精品一级在线| 欧美经典一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲色图一区二区| 欧美专区日韩专区| 日韩av一级片| 日韩精品专区在线| 国产一区亚洲一区| 国产精品美女一区二区三区| 91在线观看地址| 亚洲一区二区三区精品在线| 欧美福利视频导航| 精品中文字幕一区二区| 国产欧美精品一区二区三区四区| 99久久精品免费精品国产| 亚洲男女毛片无遮挡| 欧美日韩久久久| 精品综合久久久久久8888| 中文字幕精品—区二区四季| 色呦呦网站一区| 丝袜亚洲精品中文字幕一区| 日韩精品一区二区在线观看| 国产成人aaaa| 一区二区三区毛片| 91精品国产综合久久精品app| 另类的小说在线视频另类成人小视频在线| 精品1区2区在线观看| 成人免费看片app下载| 成人av午夜影院| 性欧美大战久久久久久久久| 欧美一区二区三区免费大片 | 久88久久88久久久| 国产精品夫妻自拍| 欧美男男青年gay1069videost| 精品一区二区精品| 自拍av一区二区三区| 欧美一区二区三区婷婷月色| 成人免费视频视频在线观看免费 | 国产精品美日韩| 欧美男男青年gay1069videost| 国产成a人亚洲精品| 亚洲五月六月丁香激情| 国产亚洲一区二区三区在线观看| 91免费看视频| 国产毛片精品视频| 一区二区三区四区精品在线视频| 日韩免费视频一区二区| 91首页免费视频| 国产一区二区三区不卡在线观看| 一区在线播放视频| 精品国产一区二区国模嫣然| 在线观看亚洲a| 成人性生交大片免费| 免费不卡在线视频| 亚洲最大的成人av| 中文欧美字幕免费| 精品卡一卡二卡三卡四在线| 91色视频在线| 成人午夜私人影院| 久久精品久久99精品久久| 亚洲综合色自拍一区| 国产精品久久毛片av大全日韩| 精品久久久久久久久久久院品网| 欧美三区在线观看| 99久久精品免费观看|