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

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

?? monthlycalendar.java

?? Java中非常實用流控制工具
?? JAVA
字號:
/* 
 * Copyright 2004-2005 OpenSymphony 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */

/*
 * Previously Copyright (c) 2001-2004 James House
 * and Juergen Donnerstag (c) 2002, EDS 2002
 */

package org.quartz.impl.calendar;

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

import org.quartz.Calendar;

/**
 * <p>
 * This implementation of the Calendar excludes a set of days of the month. You
 * may use it to exclude every first day of each month for example. But you may define
 * any day of a month.
 * </p>
 * 
 * @see org.quartz.Calendar
 * @see org.quartz.impl.calendar.BaseCalendar
 * 
 * @author Juergen Donnerstag
 */
public class MonthlyCalendar extends BaseCalendar implements Calendar,
        Serializable {

    static final long serialVersionUID = 419164961091807944L;

    private static final int MAX_DAYS_IN_MONTH = 31;

    // An array to store a months days which are to be excluded.
    // java.util.Calendar.get( ) as index.
    private boolean[] excludeDays = new boolean[MAX_DAYS_IN_MONTH];

    // Will be set to true, if all week days are excluded
    private boolean excludeAll = false;

    public MonthlyCalendar() {
        this(null, null);
    }

    public MonthlyCalendar(Calendar baseCalendar) {
        this(baseCalendar, null);
    }

    public MonthlyCalendar(TimeZone timeZone) {
        this(null, timeZone);
    }

    public MonthlyCalendar(Calendar baseCalendar, TimeZone timeZone) {
        super(baseCalendar, timeZone);
        
        // all days are included by default
        excludeAll = areAllDaysExcluded();
    }

    /**
     * <p>
     * Get the array which defines the exclude-value of each day of month.
     * Only the first 31 elements of the array are relevant, with the 0 index 
     * element representing the first day of the month.
     * </p>
     */
    public boolean[] getDaysExcluded() {
        return excludeDays;
    }

    /**
     * <p>
     * Return true, if day is defined to be excluded.
     * </p>
     * 
     * @param day The day of the month (from 1 to 31) to check.
     */
    public boolean isDayExcluded(int day) {
        if ((day < 1) || (day > MAX_DAYS_IN_MONTH)) {
            throw new IllegalArgumentException(
                "The day parameter must be in the range of 1 to " + MAX_DAYS_IN_MONTH);
        }
        
        return excludeDays[day - 1];
    }

    /**
     * <p>
     * Redefine the array of days excluded. The array must non-null and of size
     * greater or equal to 31. The 0 index element represents the first day of 
     * the month.
     * </p>
     */
    public void setDaysExcluded(boolean[] days) {
        if (days == null) {
            throw new IllegalArgumentException("The days parameter cannot be null.");
        }

        if (days.length < MAX_DAYS_IN_MONTH) {
            throw new IllegalArgumentException(
                "The days parameter must have a length of at least " + MAX_DAYS_IN_MONTH + " elements.");
        }

        excludeDays = days;
        excludeAll = areAllDaysExcluded();
    }

    /**
     * <p>
     * Redefine a certain day of the month to be excluded (true) or included
     * (false).
     * </p>
     * 
     * @param day The day of the month (from 1 to 31) to set.
     */
    public void setDayExcluded(int day, boolean exclude) {
        if ((day < 1) || (day > MAX_DAYS_IN_MONTH)) {
            throw new IllegalArgumentException(
                "The day parameter must be in the range of 1 to " + MAX_DAYS_IN_MONTH);
        }
        
        excludeDays[day - 1] = exclude;
        excludeAll = areAllDaysExcluded();
    }

    /**
     * <p>
     * Check if all days are excluded. That is no day is included.
     * </p>
     */
    public boolean areAllDaysExcluded() {
        for (int i = 1; i <= MAX_DAYS_IN_MONTH; i++) {
            if (isDayExcluded(i) == false) {
                return false;
            }
        }

        return true;
    }

    /**
     * <p>
     * Determine whether the given time (in milliseconds) is 'included' by the
     * Calendar.
     * </p>
     * 
     * <p>
     * Note that this Calendar is only has full-day precision.
     * </p>
     */
    public boolean isTimeIncluded(long timeStamp) {
        if (excludeAll == true) {
            return false;
        }

        // Test the base calendar first. Only if the base calendar not already
        // excludes the time/date, continue evaluating this calendar instance.
        if (super.isTimeIncluded(timeStamp) == false) { return false; }

        java.util.Calendar cl = createJavaCalendar(timeStamp);
        int day = cl.get(java.util.Calendar.DAY_OF_MONTH);

        return !(isDayExcluded(day));
    }

    /**
     * <p>
     * Determine the next time (in milliseconds) that is 'included' by the
     * Calendar after the given time. Return the original value if timeStamp is
     * included. Return 0 if all days are excluded.
     * </p>
     * 
     * <p>
     * Note that this Calendar is only has full-day precision.
     * </p>
     */
    public long getNextIncludedTime(long timeStamp) {
        if (excludeAll == true) {
            return 0;
        }

        // Call base calendar implementation first
        long baseTime = super.getNextIncludedTime(timeStamp);
        if ((baseTime > 0) && (baseTime > timeStamp)) {
            timeStamp = baseTime;
        }

        // Get timestamp for 00:00:00
        java.util.Calendar cl = getStartOfDayJavaCalendar(timeStamp);
        int day = cl.get(java.util.Calendar.DAY_OF_MONTH);

        if (!isDayExcluded(day)) {
            return timeStamp; // return the original value
        }

        while (isDayExcluded(day) == true) {
            cl.add(java.util.Calendar.DATE, 1);
            day = cl.get(java.util.Calendar.DAY_OF_MONTH);
        }

        return cl.getTime().getTime();
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆日韩欧美久久| 国产成人综合网| 国产精品资源站在线| 色综合激情五月| 久久久久久久久久久电影| 亚洲电影中文字幕在线观看| 国产精品资源站在线| 538prom精品视频线放| 中文字幕永久在线不卡| 久久成人羞羞网站| 欧美日韩dvd在线观看| ㊣最新国产の精品bt伙计久久| 日韩精品欧美精品| 欧美日韩久久一区二区| 国产精品成人免费| 国产91丝袜在线播放| 日韩欧美国产电影| 视频一区二区中文字幕| 欧美专区在线观看一区| 国产精品久久久久三级| 国产成人免费视频网站高清观看视频 | aaa国产一区| 国产日产欧美一区二区三区| 久久精品国产亚洲a| 欧美高清www午色夜在线视频| 一卡二卡三卡日韩欧美| 色综合久久综合网97色综合| 中文字幕视频一区二区三区久| 成人免费高清视频| 中文字幕在线观看一区| 波波电影院一区二区三区| 国产日产亚洲精品系列| 国产精品综合一区二区三区| 久久精品网站免费观看| 国产一区在线观看麻豆| xf在线a精品一区二区视频网站| 午夜a成v人精品| 欧美一区欧美二区| 视频一区在线播放| 日韩天堂在线观看| 国产一区二区视频在线| 日本一区二区免费在线| 成人激情黄色小说| 一区二区免费视频| 欧美日韩精品三区| 久久精品国产99久久6| 久久色中文字幕| 91视频www| 五月天亚洲婷婷| 日韩视频国产视频| 国产做a爰片久久毛片| 中文字幕乱码亚洲精品一区| www.亚洲在线| 亚洲成人在线观看视频| 日韩欧美aaaaaa| 粉嫩在线一区二区三区视频| 中文av字幕一区| 欧美亚洲动漫制服丝袜| 美女在线观看视频一区二区| 国产欧美一区二区三区沐欲| 色天天综合色天天久久| 日本不卡视频一二三区| 日本一区二区三区在线观看| 在线免费观看视频一区| 麻豆一区二区三区| 国产精品超碰97尤物18| 欧美一区二区三区成人| 成人黄动漫网站免费app| 亚洲一区自拍偷拍| 国产日产欧产精品推荐色| 在线观看亚洲一区| 国产精品69久久久久水密桃| 亚洲午夜激情av| 久久久久久免费| 在线免费观看日本一区| 国模套图日韩精品一区二区| 夜夜夜精品看看| 欧美国产一区二区| 日韩一区二区中文字幕| 成人自拍视频在线观看| 日本最新不卡在线| 一区二区三区四区蜜桃| 国产日产精品1区| 欧美一区二区久久久| 一本大道综合伊人精品热热| 国产精品1024久久| 日本成人在线网站| 一区二区三区四区激情| 国产亲近乱来精品视频| 日韩一区二区三区在线| 欧美日韩免费电影| 成人av免费在线播放| 韩国精品久久久| 秋霞影院一区二区| 亚洲一区成人在线| 亚洲人成亚洲人成在线观看图片| 久久久精品国产99久久精品芒果| 91精品午夜视频| 欧美丝袜丝交足nylons| 97久久精品人人爽人人爽蜜臀| 国产在线观看免费一区| 捆绑调教美女网站视频一区| 五月婷婷另类国产| 亚洲最大成人综合| 又紧又大又爽精品一区二区| 国产精品久久久久天堂| 国产精品天美传媒| 中文字幕一区免费在线观看| 中文字幕免费一区| 中文字幕av不卡| 国产精品素人一区二区| 337p日本欧洲亚洲大胆精品 | 麻豆精品视频在线观看免费 | 日韩一区二区视频在线观看| 777奇米成人网| 67194成人在线观看| 26uuu久久综合| 久久综合九色欧美综合狠狠| 欧美mv日韩mv| 久久精品夜夜夜夜久久| 国产精品久久精品日日| 国产成人a级片| 久久国产夜色精品鲁鲁99| 亚洲激情av在线| 亚洲另类春色校园小说| 亚洲欧美二区三区| 久久久99久久| 亚洲一区成人在线| 亚洲午夜久久久久久久久电影网| 亚洲理论在线观看| 日韩毛片高清在线播放| 综合婷婷亚洲小说| 亚洲一区成人在线| 日本亚洲天堂网| 精品一区二区免费视频| 国产精品影视天天线| 99热国产精品| 欧美日韩一区二区三区四区 | 中文字幕在线免费不卡| 亚洲欧洲国产专区| 五月天婷婷综合| 久久aⅴ国产欧美74aaa| 高清日韩电视剧大全免费| 色综合一区二区| 欧美高清你懂得| 欧美经典一区二区| 亚洲精品一二三区| 久久狠狠亚洲综合| 高清shemale亚洲人妖| 欧美午夜一区二区三区免费大片| 精品视频免费在线| 国产亚洲欧美日韩日本| 亚洲精品少妇30p| 久久99国内精品| 日本高清不卡一区| 欧美一级免费观看| 国产精品天美传媒| 美女网站色91| 91浏览器打开| 欧美精品一区二区高清在线观看| 亚洲欧美一区二区三区国产精品 | 久久网站最新地址| 亚洲欧美激情一区二区| 捆绑紧缚一区二区三区视频| 91色综合久久久久婷婷| 日韩欧美国产综合在线一区二区三区 | 狠狠色狠狠色综合日日91app| 色哟哟在线观看一区二区三区| 日韩视频一区在线观看| 亚洲精品成人天堂一二三| 韩国一区二区视频| 欧美日韩国产综合一区二区三区| 国产日韩欧美电影| 另类的小说在线视频另类成人小视频在线| 成人av资源站| 精品乱码亚洲一区二区不卡| 午夜精品福利在线| 99re热视频这里只精品| 久久综合九色欧美综合狠狠| 亚洲第一电影网| 色综合久久久久综合体| 国产精品久久久久久久浪潮网站| 蜜桃久久精品一区二区| 欧美日韩国产区一| 亚洲品质自拍视频| 国产宾馆实践打屁股91| 欧美成人乱码一区二区三区| 午夜精品123| 在线观看网站黄不卡| 亚洲天堂久久久久久久| 高清日韩电视剧大全免费| 久久亚洲综合色一区二区三区| 免费看日韩a级影片| 欧美精品一二三区| 亚洲观看高清完整版在线观看| 99视频精品在线| 国产精品传媒入口麻豆| 盗摄精品av一区二区三区| 国产日产欧产精品推荐色 | 国产精品久久久久四虎|