Home | History | Annotate | Download | only in calendar

Lines Matching refs:year

63     // The base Gregorian year of FIXED_DATES[]
161 // Cache for the fixed date of January 1 and year length of the
168 protected final boolean hit(int year) {
169 return year == cachedYear;
184 protected void setCache(int year, long jan1, int len) {
185 cachedYear = year;
274 int year = bdate.getNormalizedYear();
278 year -= (int)((xm / 12) + 1);
280 bdate.setNormalizedYear(year);
283 year += (int)((month - 1) / 12);
285 bdate.setNormalizedYear(year);
291 * Returns 366 if the specified date is in a leap year, or 365
298 * @return a year length in days
330 // accepts 0 (December in the previous year) to 12.
331 private int getMonthLength(int year, int month) {
333 if (month == FEBRUARY && isLeapYear(year)) {
345 final long getDayOfYear(int year, int month, int dayOfMonth) {
347 + (isLeapYear(year) ?
363 public long getFixedDate(int year, int month, int dayOfMonth, BaseCalendar.Date cache) {
366 // Look up the one year cache
367 if (cache != null && cache.hit(year)) {
371 return cache.getCachedJan1() + getDayOfYear(year, month, dayOfMonth) - 1;
375 int n = year - BASE_YEAR;
379 cache.setCache(year, jan1, isLeapYear(year) ? 366 : 365);
381 return isJan1 ? jan1 : jan1 + getDayOfYear(year, month, dayOfMonth) - 1;
384 long prevyear = (long)year - 1;
402 days -= isLeapYear(year) ? 1 : 2;
407 cache.setCache(year, days, isLeapYear(year) ? 366 : 365);
421 int year;
425 year = gdate.getCachedYear();
427 isLeap = isLeapYear(year);
430 // much. So we calculate year and jan1. getFixedDate()
432 year = getGregorianYearFromFixedDate(fixedDate);
433 jan1 = getFixedDate(year, JANUARY, 1, null);
434 isLeap = isLeapYear(year);
436 gdate.setCache (year, jan1, isLeap ? 366 : 365);
460 gdate.setNormalizedYear(year);
489 * Returns the Gregorian year number of the given fixed date.
495 int year;
518 year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
520 ++year;
522 return year;
526 * @return true if the specified year is a Gregorian leap year, or