Home | History | Annotate | Download | only in util

Lines Matching defs:year

37  * <code>YEAR</code>, <code>MONTH</code>, <code>DAY</code>, <code>HOUR</code>,
71 * as well as their meaning. For example, the first month of the year has value
74 * <code>YEAR</code>. See individual field documentation and subclass
95 * first week of the month or year as a reference point. The first week of a
96 * month or year is defined as the earliest seven day period beginning on
98 * <code>getMinimalDaysInFirstWeek()</code> days of that month or year. Weeks
102 * designate the week before week 1 of a year as week <em>n</em> of the previous
103 * year.
107 * <code>Date</code> (such as only year and month but no day in the month),
115 * start of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc.
161 * specification of the historial Arabic astronomical calendar requires year,
241 * adding 13 months to August gives September of the next year. Since
268 * <code>YEAR</code> field value of 1999.</p>
287 * year, and an underlying <code>GregorianCalendar</code>. If the
388 * week-of-year behavior.</li>
429 * <p>The {@link #ERA}, {@link #YEAR},
438 * to compute the {@link #ERA}, {@link #YEAR},
450 * month, day of month, and extended year for the given date.</li>
461 * thing the subclass must do is determine the extended year, based on
462 * the year fields, and then, given an extended year and a month, it must
468 * to return the extended year for this calendar system, based on the
469 * {@link #YEAR}, {@link #EXTENDED_YEAR}, and any fields that
470 * the calendar system uses that are larger than a year, such as
475 * associated with a month and extended year. This is the Julian day
488 * given month of a given extended year. The month number, as always,
493 * extended year. This method is used by
500 * fields {@link #ERA}, {@link #YEAR}, {@link #MONTH},
538 * (Adar) in a non-leap year. The protected utility method {@link
564 * {@link #YEAR}, {@link #MONTH}, and
571 * designation of week number one of a month or year, they all use a
615 * {@link #YEAR}, {@link #ERA}, etc. fields. Then, if the
620 * year</em>. This differs from the {@link #YEAR} field in that
623 * {@link #YEAR} field and all larger fields. Thus, for the
625 * <code>ERA==AD ? YEAR : 1-YEAR</code>. Another example is the Mayan
663 // local fields (YEAR, MONTH, DATE, HOUR, MINUTE, etc.)
685 // local fields (YEAR, MONTH, DATE, HOUR, MINUTE, etc.)
706 * year. This is a calendar-specific value; see subclass documentation.
709 public final static int YEAR = 1;
713 * month. This is a calendar-specific value. The first month of the year is
714 * <code>JANUARY</code>; the last depends on the number of months in a year.
734 * week number within the current year. The first week of the year, as
738 * the year.
778 * number within the current year. The first day of the year has value 1.
895 * indicating the extended year corresponding to the
912 * indicating the extended year. This is a single number designating
913 * the year of this calendar system, encompassing all supra-year
914 * fields. For example, for the Julian calendar system, year numbers
915 * are positive, with an era of BCE or CE. An extended year value for
917 * negative values to BCE years, with 1 BCE being year 0.
1022 * first month of the year.
1029 * second month of the year.
1036 * third month of the year.
1043 * fourth month of the year.
1050 * fifth month of the year.
1057 * sixth month of the year.
1064 * seventh month of the year.
1071 * eighth month of the year.
1078 * ninth month of the year.
1085 * tenth month of the year.
1092 * eleventh month of the year.
1099 * twelfth month of the year.
1106 * thirteenth month of the year. Although {@link GregorianCalendar}
1400 * The number of days required for the first week in a month or year,
1536 * The Gregorian year, as computed by computeGregorianFields() and
1548 * The Gregorian day of the year, as computed by
1680 (1 << YEAR) |
2098 * Sets the values for the fields year, month, and date.
2101 * @param year the value used to set the YEAR time field.
2107 public final void set(int year, int month, int date)
2109 set(YEAR, year);
2115 * Sets the values for the fields year, month, date, hour, and minute.
2118 * @param year the value used to set the YEAR time field.
2126 public final void set(int year, int month, int date, int hour, int minute)
2128 set(YEAR, year);
2136 * Sets the values for the fields year, month, date, hour, minute, and second.
2139 * @param year the value used to set the YEAR time field.
2148 public final void set(int year, int month, int date, int hour, int minute,
2151 set(YEAR, year);
2162 // (default implementation will do no year adjustment)
2167 private static int gregoYearFromIslamicStart(int year) {
2172 if (year >= 1397) {
2173 cycle = (year - 1397) / 67;
2174 offset = (year - 1397) % 67;
2177 cycle = (year - 1396) / 67 - 1;
2178 offset = -(year - 1396) % 67;
2181 return year + 579 - shift;
2190 int year = get(EXTENDED_YEAR);
2201 year += 622; break;
2203 year -= 3760; break;
2205 year -= 2637; break;
2207 year += 79; break;
2209 year += 284; break;
2211 year += 8; break;
2213 year -=5492; break;
2215 year -= 2333; break;
2221 year = gregoYearFromIslamicStart(year); break;
2231 return year;
2237 // (default implementation will do no year adjustment)
2242 private static int firstIslamicStartYearFromGrego(int year) {
2247 if (year >= 1977) {
2248 cycle = (year - 1977) / 65;
2249 offset = (year - 1977) % 65;
2252 cycle = (year - 1976) / 65 - 1;
2253 offset = -(year - 1976) % 65;
2256 return year - 579 + shift;
2264 public final void setRelatedYear(int year) {
2275 year -= 622; break;
2277 year += 3760; break;
2279 year += 2637; break;
2281 year -= 79; break;
2283 year -= 284; break;
2285 year -= 8; break;
2287 year +=5492; break;
2289 year += 2333; break;
2295 year = firstIslamicStartYearFromGrego(year); break;
2305 set(EXTENDED_YEAR, year);
2476 * of the DAY_OF_YEAR or MONTH depends only on the year and supra-year
2613 case YEAR:
2637 // or year will contain the first day of the week, and that the
2711 * When rolling on the {@link #YEAR} field, it will roll the year
2713 * {@link #getMaximum getMaximum}({@link #YEAR}).
2723 * Gregorian calendar, starting with 100 BC and rolling the year up results in 99 BC.
2725 * most eras in the Japanese calendar) then rolling the year past either limit of the
2726 * era will cause the year to wrap around. When eras only have a limit at one end,
2727 * then attempting to roll the year past that limit will result in pinning the year
2783 * Gregorian calendar, starting with 100 BC and rolling the year by + 1 results in 99 BC.
2785 * most eras in the Japanese calendar) then rolling the year past either limit of the
2786 * era will cause the year to wrap around. When eras only have a limit at one end,
2787 * then attempting to roll the year past that limit will result in pinning the year
2823 * non-leap year.
2912 case YEAR:
2937 year instead of wrapping
2942 // calendars with years that go backwards must pin the year value at 0,
2953 // Rolling the year can involve pinning the DAY_OF_MONTH.
3043 // to the whole year. Please see the comment for WEEK_OF_MONTH
3052 // of the year.
3056 // Get the first day of the first full week of the year,
3067 // day of the year.
3072 // Get the limit day for the blocked-off rectangular year; that
3073 // is, the day which is one past the last day of the year,
3074 // after the year has already been filled in with phantom days
3089 // Make sure that the year and day of year are attended to by
3099 // Roll the day of year using millis. Compute the millis for
3100 // the start of the year, and get the length of the year.
3171 * calendar, starting with 100 BC and adding +1 to year results in 99 BC (even though
3202 * to a date in Shevat gives the proper result (Adar) in a non-leap year.
3249 case YEAR:
3254 // * Note that for YEAR (but not YEAR_WOY) we could instead handle
3257 // also handle YEAR the same way.
3477 * followed by an = sign, followed by the numbering system name. For example, to specify that just the year
3480 * Thai digits for the month and Devanagari digits for the year.
3894 * a year or the week number in a month. Usually this will be a value &gt;= 1, but if
3937 // in question (either a year or a month). Zero represents the
3957 * a year, or the week number in a month. Usually this will be a value &gt;= 1, but if
4018 * int y = cal.fieldDifference(when, Calendar.YEAR);
4054 // February 29, 2004. If 1, 1, 1, 1 is added to the year
4324 * Sets what the minimal days required in the first week of the year are.
4326 * day of the first month of a year, call the method with value 1. If it
4329 * of the year.
4349 * Returns what the minimal days required in the first week of the year are.
4351 * of the first month of a year, getMinimalDaysInFirstWeek returns 1. If
4354 * @return the minimal days required in the first week of the year.
4365 {/* */}, // YEAR
4395 * YEAR
5053 // EXTENDED_YEAR, YEAR, DAY_OF_YEAR. This method will call internalSet(),
5080 * Compute the Gregorian calendar year, month, and day of month from
5100 * Compute the Gregorian calendar year, month, and day of month from the
5111 int year, month, dayOfMonth, dayOfYear;
5113 // The Gregorian epoch day is zero for Monday January 1, year 1.
5117 // representation. We use 400-year, 100-year, and 4-year cycles.
5118 // For example, the 4-year cycle has 4 years + 1 leap day; giving
5121 int n400 = floorDivide(gregorianEpochDay, 146097, rem); // 400-year cycle length
5122 int n100 = floorDivide(rem[0], 36524, rem); // 100-year cycle length
5123 int n4 = floorDivide(rem[0], 1461, rem); // 4-year cycle length
5125 year = 400*n400 + 100*n100 + 4*n4 + n1;
5126 dayOfYear = rem[0]; // zero-based day of year
5130 ++year;
5133 boolean isLeap = ((year&0x3) == 0) && // equiv. to (year%4 == 0)
5134 (year%100 != 0 || year%400 == 0);
5143 gregorianYear = year;
5151 * DAY_OF_WEEK_IN_MONTH, and DOW_LOCAL from EXTENDED_YEAR, YEAR,
5155 * <p>The YEAR_WOY field is computed simplistically. It is equal to YEAR
5156 * most of the time, but at the year boundary it may be adjusted to YEAR-1
5157 * or YEAR+1 to reflect the overlap of a week into an adjacent year. In
5158 * this case, a simple increment or decrement is performed on YEAR, even
5159 * though this may yield an invalid YEAR value. For instance, if the YEAR
5160 * is part of a calendar system with an N-year cycle field CYCLE, then
5161 * incrementing the YEAR may involve incrementing CYCLE and setting YEAR
5164 * fields for fields larger than or equal to a year. This additional
5167 * proleptic Gregorian calendar, which has no field larger than a year.
5175 // Compute the week of the year. For the Gregorian calendar, valid week
5176 // numbers run from 1 to 52 or 53, depending on the year, the first day
5178 // calendars, the valid range may be different -- it depends on the year
5179 // length. Days at the start of the year may fall into the last week of
5180 // the previous year; days at the end of the year may fall into the
5181 // first week of the next year. ASSUME that the year length is less than
5191 // Adjust for weeks at the year end that overlap into the previous or
5192 // next calendar year.
5194 // We are the last week of the previous year.
5197 // next year.
5204 // Fast check: For it to be week 1 of the next year, the DOY
5206 // cannot possibly be week 1 of the next year:
5243 // Default table for day in year
5254 { RESOLVE_REMAP | DAY_OF_MONTH, YEAR }, // if YEAR is set over YEAR_WOY use DAY_OF_MONTH
5903 * given month in the given extended year. Subclasses should override
5905 * @param eyear the extended year
5908 * the given year, otherwise, compute the day before the first day of
5911 * day of the given month and year
5918 * Returns the extended year defined by the current fields. This will
5919 * use the EXTENDED_YEAR field or the YEAR and supra-year fields (such
5922 * @return the extended year
5932 * year of this calendar system. Subclasses should override this
5944 * Returns the number of days in the given extended year of this
5969 * Called by handleComputeJulianDay. Returns the default month (0-based) for the year,
5970 * taking year and era into account. Defaults to 0 (JANUARY) for Gregorian.
5984 * taking currently-set year and era into account. Defaults to 1 for Gregorian.
6009 int year;
6012 // Nota Bene! It is critical that YEAR_WOY be used as the year here, if it is
6013 // set. Otherwise, when WOY is the best field, the year may be wrong at the
6014 // extreme limits of the year. If YEAR_WOY is not set then it will fall back.
6016 year = internalGet(YEAR_WOY, handleGetExtendedYear());
6018 year = handleGetExtendedYear();
6021 internalSet(EXTENDED_YEAR, year);
6023 int month = useMonth ? internalGet(MONTH, getDefaultMonthInYear(year)) : 0;
6025 // Get the Julian day of the day BEFORE the start of this year.
6027 int julianDay = handleComputeMonthStart(year, month, useMonth);
6031 return julianDay + internalGet(DAY_OF_MONTH, getDefaultDayInMonth(year, month));
6033 return julianDay + getDefaultDayInMonth(year, month);
6044 // January 1, year 1 of the given calendar. If julianDay == 0, it
6053 // Get the 0-based localized DOW of day one of the month or year.
6076 // Find the first target DOW (dowLocal) in the month or year.
6077 // Actually, it may be just before the first of the month or year.
6083 // Adjust the target DOW to be in the month or year.
6102 int monthLength = handleGetMonthLength(year, m);
6125 * @param year extended Gregorian year
6128 * day of the given month in the given extended year
6132 protected int computeGregorianMonthStart(int year, int month) {
6135 // modify the extended year value accordingly.
6138 year += floorDivide(month, 12, rem);
6142 boolean isLeap = (year%4 == 0) && ((year%100 != 0) || (year%400 == 0));
6143 int y = year - 1;
6172 * <li>YEAR
6203 internalSet(YEAR, eyear);
6213 * Returns the extended year on the Gregorian calendar as computed by
6233 * Returns the day of year (1-based) on the Gregorian calendar as
6296 // len2 length of month in a leap year
6297 // st days in year before start of month
6298 // st2 days in year before month in leap year
6302 * Determines if the given year is a leap year. Returns true if the
6303 * given year is a leap year.
6304 * @param year the given year.
6305 * @return true if the given year is a leap year; false otherwise.
6308 protected static final boolean isGregorianLeapYear(int year) {
6309 return (year%4 == 0) && ((year%100 != 0) || (year%400 == 0));
6314 * @param y the extended year
6325 * @param y the extended year
6423 "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH",
6501 * Returns if two digit representation of year in this calendar type