private static Map < String , Integer > appendDisplayNames ( final Calendar cal , final Locale locale , final int field , final StringBuilder regex ) { final Map < String , Integer > values = new HashMap <> ( ) ; final Map < String , Integer > displayNames = cal . getDisplayNames ( field , Calendar . ALL_STYLES , locale ) ; final TreeSet < String > sorted = new TreeSet <> ( LONGER_FIRST_LOWERCASE ) ; for ( final Map . Entry < String , Integer > displayName : displayNames . entrySet ( ) ) { final String key = displayName . getKey ( ) . toLowerCase ( locale ) ; if ( sorted . add ( key ) ) { values . put ( key , displayName . getValue ( ) ) ; } } for ( final String symbol : sorted ) { simpleQuote ( regex , symbol ) . append ( ' ' ) ; } return values ; }
Get the short and long values displayed for a field