protected int computeJulianDay ( ) { // We want to see if any of the date fields is newer than the // JULIAN_DAY. If not, then we use JULIAN_DAY. If so, then we do // the normal resolution. We only use JULIAN_DAY if it has been // set by the user. This makes it possible for the caller to set // the calendar to a time and call clear(MONTH) to reset the MONTH // to January. This is legacy behavior. Without this, // clear(MONTH) has no effect, since the internally set JULIAN_DAY // is used. if ( stamp [ JULIAN_DAY ] >= MINIMUM_USER_STAMP ) { int bestStamp = newestStamp ( ERA , DAY_OF_WEEK_IN_MONTH , UNSET ) ; bestStamp = newestStamp ( YEAR_WOY , EXTENDED_YEAR , bestStamp ) ; if ( bestStamp <= stamp [ JULIAN_DAY ] ) { return internalGet ( JULIAN_DAY ) ; } } int bestField = resolveFields ( getFieldResolutionTable ( ) ) ; if ( bestField < 0 ) { bestField = DAY_OF_MONTH ; } return handleComputeJulianDay ( bestField ) ; }
Compute the Julian day number as specified by this calendar s fields .