• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.util;
2 
3 import java.util.HashMap;
4 import java.util.Map;
5 
6 /**
7  * This list needs updating as a new organizations are added; that's by design
8  * so that we know when new ones show up.
9  */
10 public enum Organization {
11     // Please update Locales.txt for default coverage when adding an organization here.
12 
13     adlam("Winden Jangen Adlam"), adobe("Adobe"), afghan_csa("Afghan CSA"), afghan_mcit("Afghan MCIT"), afrigen("Afrigen"), apple("Apple"), bangladesh(
14         "Bangladesh Computer Council"), bangor_univ("Bangor Univ."), bhutan("Bhutan DDC"), breton("Office of Breton Lang"), cherokee("Cherokee Nation"), cldr(
15             "Cldr"), facebook("Facebook"), gaeilge("Foras na Gaeilge"), georgia_isi("Georgia ISI"), gnome("Gnome Foundation"), google(
16                 "Google"), guest("Guest (Unicode)"), ibm("IBM"), india("India MIT"), iran_hci("Iran HCI"), kendra("Kendra (Nepal)"), kotoistus(
17                     "Kotoistus (Finnish IT Ctr)"), lakota_lc("Lakota LC"), lao_dpt("Lao Posts/Telecom??"), longnow("The Long Now Foundation", "Long Now",
18                         "PanLex"), microsoft("Microsoft"), mozilla("Mozilla"), netflix("Netflix"), openinstitute("Open Inst (Cambodia)"), openoffice_org(
19                             "Open Office"), oracle("Oracle", "sun", "Sun Micro"), pakistan("Pakistan"), rumantscha("Lia Rumantscha"), sil("SIL"), srilanka(
20                                 "Sri Lanka ICTA",
21                                 "Sri Lanka"), surveytool("Survey Tool"), welsh_lc("Welsh LC"), wikimedia("Wikimedia Foundation"), yahoo("Yahoo"),
22     // To be removed.
23     ;
24 
25     public final String displayName;
26     private final String[] names;
27 
fromString(String name)28     public static Organization fromString(String name) {
29         name = name.toLowerCase().replace('-', '_').replace('.', '_');
30         Organization org = OrganizationNameMap.get(name);
31         return org;
32     }
33 
getDisplayName()34     public String getDisplayName() {
35         return displayName;
36     }
37 
38     static Map<String, Organization> OrganizationNameMap;
39     static {
40         OrganizationNameMap = new HashMap<String, Organization>();
41         for (Organization x : values()) {
42             OrganizationNameMap.put(x.displayName.toLowerCase().replace('-', '_').replace('.', '_'), x);
43             for (String name : x.names) {
44                 OrganizationNameMap.put(name.toLowerCase().replace('-', '_').replace('.', '_'), x);
45             }
46             OrganizationNameMap.put(x.name().toLowerCase().replace('-', '_').replace('.', '_'), x);
47         }
48     }
49 
Organization(String displayName, String... names)50     private Organization(String displayName, String... names) {
51         this.displayName = displayName;
52         this.names = names;
53     }
54 }
55