static void register() {

        HashMap<String, Set<String>> seen = new HashMap<String, Set<String>>(); // old code used set, but was dependent on order

        for (Enumeration<String> s = Transliterator.getAvailableSources(); s.hasMoreElements(); ) {
            String source = s.nextElement();

            // Ignore the "Any" source
            if (source.equalsIgnoreCase(ANY)) continue;

            for (Enumeration<String> t = Transliterator.getAvailableTargets(source);
                 t.hasMoreElements(); ) {
                String target = t.nextElement();

                // Get the script code for the target.  If not a script, ignore.
                int targetScript = scriptNameToCode(target);
                if (targetScript == UScript.INVALID_CODE) {
                    continue;
                }

                Set<String> seenVariants = seen.get(target);
                if (seenVariants == null) {
                    seen.put(target, seenVariants = new HashSet<String>());
                }

                for (Enumeration<String> v = Transliterator.getAvailableVariants(source, target);
                     v.hasMoreElements(); ) {
                    String variant = v.nextElement();

                    // Only process each target/variant pair once
                    if (seenVariants.contains(variant)) {
                        continue;
                    }
                    seenVariants.add(variant);

                    String id;
                    id = TransliteratorIDParser.STVtoID(ANY, target, variant);
                    AnyTransliterator trans = new AnyTransliterator(id, target, variant,
                                                                    targetScript);
                    Transliterator.registerInstance(trans);
                    Transliterator.registerSpecialInverse(target, NULL_ID, false);
                }
            }
        }
    }
static void register ( ) { HashMap < String , Set < String > > seen = new HashMap < String , Set < String > > ( ) ; for ( Enumeration < String > s = Transliterator . getAvailableSources ( ) ; s . hasMoreElements ( ) ; ) { String source = s . nextElement ( ) ; if ( source . equalsIgnoreCase ( ANY ) ) continue ; for ( Enumeration < String > t = Transliterator . getAvailableTargets ( source ) ; t . hasMoreElements ( ) ; ) { String target = t . nextElement ( ) ; int targetScript = scriptNameToCode ( target ) ; if ( targetScript == UScript . INVALID_CODE ) { continue ; } Set < String > seenVariants = seen . get ( target ) ; if ( seenVariants == null ) { seen . put ( target , seenVariants = new HashSet < String > ( ) ) ; } for ( Enumeration < String > v = Transliterator . getAvailableVariants ( source , target ) ; v . hasMoreElements ( ) ; ) { String variant = v . nextElement ( ) ; if ( seenVariants . contains ( variant ) ) { continue ; } seenVariants . add ( variant ) ; String id ; id = TransliteratorIDParser . STVtoID ( ANY , target , variant ) ; AnyTransliterator trans = new AnyTransliterator ( id , target , variant , targetScript ) ; Transliterator . registerInstance ( trans ) ; Transliterator . registerSpecialInverse ( target , NULL_ID , false ) ; } } } }
Registers standard transliterators with the system.  Called by
Transliterator during initialization.  Scan all current targets
and register those that are scripts T as Any-T/V.