public static boolean isYear ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; if ( ! isNonnegativeInteger ( s ) ) return false ; return ( ( s . length ( ) == 2 ) || ( s . length ( ) == 4 ) ) ; }
isYear returns true if string s is a valid Year number . Must be 2 or 4 digits only .