private static boolean isNumericToken ( String token ) { int tokenLen = token . length ( ) ; if ( tokenLen > 0 ) { char c = token . charAt ( 0 ) ; switch ( c ) { case ' ' : // century (number) case ' ' : // century of era (number) case ' ' : // weekyear (number) case ' ' : // year (number) case ' ' : // year of era (number) case ' ' : // day of month (number) case ' ' : // hour of day (number, 1..12) case ' ' : // hour of day (number, 0..23) case ' ' : // minute of hour (number) case ' ' : // second of minute (number) case ' ' : // fraction of second (number) case ' ' : // day of week (number) case ' ' : // day of year (number) case ' ' : // day of week in month (number) case ' ' : // week of year (number) case ' ' : // week of month (number) case ' ' : // hour of day (1..24) case ' ' : // hour of day (0..11) return true ; case ' ' : // month of year (text and number) if ( tokenLen <= 2 ) { return true ; } } } return false ; }
Returns true if token should be parsed as a numeric field .