private boolean diffCalFieldValue ( Calendar fromCalendar , Calendar toCalendar , Object [ ] items , int i ) throws IllegalArgumentException { if ( items [ i ] instanceof String ) { return false ; } PatternItem item = ( PatternItem ) items [ i ] ; char ch = item . type ; int patternCharIndex = getIndexFromChar ( ch ) ; if ( patternCharIndex == - 1 ) { throw new IllegalArgumentException ( "Illegal pattern character " + "'" + ch + "' in \"" + pattern + ' ' ) ; } final int field = PATTERN_INDEX_TO_CALENDAR_FIELD [ patternCharIndex ] ; if ( field >= 0 ) { int value = fromCalendar . get ( field ) ; int value_2 = toCalendar . get ( field ) ; if ( value != value_2 ) { return true ; } } return false ; }
check whether the i - th item in 2 calendar is in different value .