• 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     adlam("Winden Jangen Adlam"),
13     adobe("Adobe"),
14     afghan_csa("Afghan CSA"),
15     afghan_mcit("Afghan MCIT"),
16     afrigen("Afrigen"),
17     apple("Apple"),
18     bangladesh("Bangladesh", "Bangladesh Computer Council"),
19     bangor_univ("Bangor Univ."),
20     bhutan("Bhutan DDC"),
21     breton("Office of Breton Lang"),
22     cherokee("Cherokee Nation"),
23     cldr("Cldr"),
24     facebook("Facebook"),
25     gaeilge("Foras na Gaeilge"),
26     georgia_isi("Georgia ISI"),
27     gnome("Gnome Foundation"),
28     google("Google"),
29     guest("Guest (Unicode)"),
30     ibm("IBM"),
31     india("India MIT"),
32     iran_hci("Iran HCI"),
33     kendra("Kendra (Nepal)"),
34     kotoistus("Kotoistus (Finnish IT Ctr)"),
35     lakota_lc("Lakota LC"),
36     lao_dpt("Lao Posts/Telecom??"),
37     longnow("The Long Now Foundation", "Long Now","PanLex"),
38     microsoft("Microsoft"),
39     mozilla("Mozilla"),
40     netflix("Netflix"),
41     openinstitute("Open Inst (Cambodia)"),
42     openoffice_org("Open Office"),
43     oracle("Oracle", "sun", "Sun Micro"),
44     pakistan("Pakistan"),
45     rumantscha("Lia Rumantscha"),
46     sil("SIL", "SIL International"),
47     srilanka("Sri Lanka ICTA", "Sri Lanka"),
48     surveytool("Survey Tool"),
49     welsh_lc("Welsh LC"),
50     wikimedia("Wikimedia Foundation"),
51     yahoo("Yahoo"),
52     // To be removed.
53     ;
54 
55     public final String displayName;
56     private final String[] names;
57 
fromString(String name)58     public static Organization fromString(String name) {
59         name = name.toLowerCase().replace('-', '_').replace('.', '_');
60         Organization org = OrganizationNameMap.get(name);
61         return org;
62     }
63 
getDisplayName()64     public String getDisplayName() {
65         return displayName;
66     }
67 
68     static Map<String, Organization> OrganizationNameMap;
69     static {
70         OrganizationNameMap = new HashMap<String, Organization>();
71         for (Organization x : values()) {
72             OrganizationNameMap.put(x.displayName.toLowerCase().replace('-', '_').replace('.', '_'), x);
73             for (String name : x.names) {
74                 OrganizationNameMap.put(name.toLowerCase().replace('-', '_').replace('.', '_'), x);
75             }
76             OrganizationNameMap.put(x.name().toLowerCase().replace('-', '_').replace('.', '_'), x);
77         }
78     }
79 
Organization(String displayName, String... names)80     private Organization(String displayName, String... names) {
81         this.displayName = displayName;
82         this.names = names;
83     }
84 }
85