⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bigdate.java

📁 How to get the java home dir.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    private static final int Jan_01_0004;

    /**
     * Constant: ordinal of 1600 Jan 01, the first year when the mod 100 leap year rule first had any effect.
     */
    private static final int Jan_01_Leap100RuleYear;

    /**
     * Constant: ordinal of 1600 Jan 01, the year when the mod 400 leap year rule first had any effect.
     */
    private static final int Jan_01_Leap400RuleYear;

    /**
     * January is 1
     */
    public static final int JANUARY = 1;

    /**
     * July is 7
     */
    public static final int JUL = 7;

    /**
     * July is 7
     */
    public static final int JULY = 7;

    /**
     * June is 6
     */
    public static final int JUN = 6;

    /**
     * June is 6
     */
    public static final int JUNE = 6;

    /**
     * Constant: year that the mod 100 rule first had any effect. For The Gregorian Calendar, 1600. For the British
     * Calendar, 1800. Round up to next 100 years after the missing day anomaly.
     */
    private static final int Leap100RuleYYYY;

    /**
     * Constant: year that the mod 400 rule first had any effect. For The Gregorian Calendar, 1600. For the British
     * Calendar, 2000. Round up to next 400 years after the missing day anomaly.
     */
    private static final int Leap400RuleYYYY;

    /**
     * March is 3
     */
    public static final int MAR = 3;

    /**
     * March is 3
     */
    public static final int MARCH = 3;

    /**
     * Constant: biggest ordinal that BigDate will accept, corresponds to 999,999 Dec 31 AD.
     */
    public static final int MAX_ORDINAL;

    /**
     * Constant: biggest year that BigDate handles, 999,999 AD.
     */
    public static final int MAX_YEAR = 999999;

    /**
     * May is 5
     */
    public static final int MAY = 5;

    /**
     * Constant: earliest ordinal that BigDate handles; corresponds to 999,999 Jan 01 BC.
     */
    public static final int MIN_ORDINAL;

    /**
     * Constant: earliest year that BigDate handles, 999,999 BC.
     *
     * @noinspection WeakerAccess
     */
    public static final int MIN_YEAR = -999999;

    /**
     * Constant: how many days were lost during the Gregorian correction, 10 for the Gregorian calendar, 11 for the
     * British.
     */
    private static final int missingDays;

    /**
     * Monday in Bigdate is 1
     */
    public static final int MON = 1;

    /**
     * Monday in Bigdate is 1
     */
    public static final int MONDAY = 1;

    /**
     * Adjustment to make Monday come out as day 0 after doing 7 modulus. Accounts for fact MIN_ORDINAL was not a
     * Monday
     */
    private static final int MondayIsZeroAdjustment = 3;

    /**
     * Constant: when passed to a constructor, it means any invalid dates are converted into the equivalent valid
     * one.<br/> e.g. 1954 September 31 -> 1954 October 1. <br/> 1954 October -1 -> 1954 September 29.<br/> 1954 13 01
     * -> 1955 01 01.
     *
     * @see #CHECK
     * @see #BYPASSCHECK
     * @see #NORMALIZE
     */
    public static final int NORMALISE = 2;

    /**
     * Constant: American spelling alias for NORMALISE.
     *
     * @see #CHECK
     * @see #BYPASSCHECK
     * @see #NORMALISE
     */
    public static final int NORMALIZE;

    /**
     * November is 11
     */
    public static final int NOV = 11;

    /**
     * November is 11
     */
    public static final int NOVEMBER = 11;

    /**
     * Constant: ordinal to represent a null date -2,147,483,648, null Gregorian is 0,0,0.
     */
    public static final int NULL_ORDINAL = Integer.MIN_VALUE;

    /**
     * October is 10
     */
    public static final int OCT = 10;

    /**
     * October is 10
     */
    public static final int OCTOBER = 10;

    /**
     * Constant: day of the last day of the month of the old Julian calendar. Pope Gregory: 1582 Oct 4, British: 1752
     * Sep 2
     */
    private static final int OJC_lastDD;

    /**
     * Constant: month of the last date of the old Julian Calendar Pope Gregory: 1582 Oct 4, British: 1752 Sep 2
     */
    private static final int OJC_lastMM;

    /**
     * Constant: year of the last date (1582 Oct 4) of the old Julian calendar, just prior to the missing 10 days, =
     * 1852. Different parts of the world made the transition at different times. Usually 1582 Oct 4. For British
     * calender it would be 1752 Sep 2 .
     */
    private static final int OJC_lastYYYY;

    /**
     * Saturday in Bigdate is 6
     */
    public static final int SAT = 6;

    /**
     * Saturday in Bigdate is 6
     */
    public static final int SATURDAY = 6;

    /**
     * September is 9
     */
    public static final int SEP = 9;

    /**
     * September is 9
     */
    public static final int SEPTEMBER = 9;

    /**
     * Sunday is 0
     */
    public static final int SUN = 0;

    /**
     * Sunday is 0
     */
    public static final int SUNDAY = 0;

    /**
     * Adjustment to make Sunday come out as day 0 after doing 7 modulus. Accounts for fact MIN_ORDINAL was not a
     * Sunday.
     */
    private static final int SundayIsZeroAdjustment = 4;

    /**
     * Thursday in Bigdate is 4
     */
    public static final int THU = 4;

    /**
     * Thursday in Bigdate is 4
     */
    public static final int THURSDAY = 4;

    /**
     * Tuesday in Bigdate is 2
     */
    public static final int TUE = 2;

    /**
     * Tuesday in Bigdate is 2
     */
    public static final int TUESDAY = 2;

    /**
     * Wednesday in Bigdate is 3
     */
    public static final int WED = 3;

    /**
     * Wednesday in Bigdate is 3
     */
    public static final int WEDNESDAY = 3;

    /**
     * Constant : value for a null TimeStamp -9,223,372,036,854,775,808
     *
     * @noinspection WeakerAccess
     */
    public static final long NULL_TIMESTAMP = Long.MIN_VALUE;

    /**
     * used to identify this version of serialised BigDate objects
     */
    static final long serialVersionUID = 34L;

    /**
     * days of the week 3 letter abbreviations in English. Index Sunday = 0.
     */
    private static final String[] dayAbbr =
            { "sun", "mon", "tue", "wed", "thu", "fri", "sat" };

    /**
     * full days of the week in English. Index Sunday = 0.
     */
    private static final String[] dayName =
            { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };

    /**
     * 3-letter Months of the year in English. index January = 1
     */
    private static final String[] monthAbbr = {
            "???",
            "Jan",
            "Feb",
            "Mar",
            "Apr",
            "May",
            "Jun",
            "Jul",
            "Aug",
            "Sep",
            "Oct",
            "Nov",
            "Dec" };

    /**
     * full Months of the year in English. index January = 1
     */
    private static final String[] monthName = {
            "unknown",
            "January",
            "February",
            "March",
            "April",
            "May",
            "June",
            "July",
            "August",
            "September",
            "October",
            "November",
            "December" };

    /**
     * Constant array: how many days in the year prior to the first of the given month in a leap year. Indexed by
     * Jan=0.
     */
    private static final int[] leap_daysInYearPriorToMonthTable = {
            0, 31, 60, /* J F M */
            91, 121, 152, /* A M J */
            182, 213, 244, /* J A S */
            274, 305, 335 };/* O N D */

    /**
     * Constant array: what month does the indexing day number fall in a leap year? Indexed by ddd Jan 1 = 0.
     */
    private static int[] leap_dddToMMTable;

    /**
     * Constant array: how many days in the year prior to the first of the given month in a non-leap year. Indexed by
     * Jan=0.
     */
    private static final int[] usual_daysInYearPriorToMonthTable = {
            0, 31, 59, /* J F M */
            90, 120, 151, /* A M J */
            181, 212, 243, /* J A S */
            273, 304, 334 };/* O N D */

    // P R I V A T E _ T A B L E S _ F O R _ D A T E _ C O N V E R S I O N

    /**
     * Constant array: how many days are in there in a month, (not a leap year). Indexed by Jan = 0.
     */
    private static final int[] usual_DaysPerMonthTable = {
            31, 28, 31, /* J F M */
            30, 31, 30, /* A M J */
            31, 31, 30, /* J A S */
            31, 30, 31 };/* O N D */

    /**
     * Constant array: what month does the indexing day number fall in a non-leap year? Indexed by ddd Jan 1 = 0.
     */
    private static int[] usual_dddToMMTable;

    /**
     * Day, 1 to 31. If size of BigDate objects were a consideration, you could make this a byte.
     *
     * @noinspection WeakerAccess
     */
    protected transient int dd = 0;

    /**
     * Month, 1 to 12. If size of BigDate objects were a consideration, you could make this a byte.
     *
     * @noinspection WeakerAccess
     */
    protected transient int mm = 0;

    /**
     * Ordinal days since Jan 01, 1970. -365968798 to 364522971. i.e. 999,999 BC to 999,999 AD.
     */
    protected int ordinal = NULL_ORDINAL;

    /**

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -