@Test public void test_default_english() { Pluralizer pEn = PluralizerRegistry.INSTANCE.find(Locale.UK); assertThat(pEn.pluralOf("sheep"), is("sheep")); }
public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p != null) return p; } l = control.getFallbackLocale(PLURALIZER_CLASS, l); } return null; }
PluralizerRegistry { public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p != null) return p; } l = control.getFallbackLocale(PLURALIZER_CLASS, l); } return null; } }
PluralizerRegistry { public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p != null) return p; } l = control.getFallbackLocale(PLURALIZER_CLASS, l); } return null; } PluralizerRegistry();  PluralizerRegistry(Control c); }
PluralizerRegistry { public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p != null) return p; } l = control.getFallbackLocale(PLURALIZER_CLASS, l); } return null; } PluralizerRegistry();  PluralizerRegistry(Control c); static PluralizerRegistry instance(); synchronized Pluralizer register(Locale l, Pluralizer p); synchronized Pluralizer find(Locale l); synchronized Pluralizer getRegistered(Locale l); synchronized PluralizerRegistry copy(); }
PluralizerRegistry { public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p != null) return p; } l = control.getFallbackLocale(PLURALIZER_CLASS, l); } return null; } PluralizerRegistry();  PluralizerRegistry(Control c); static PluralizerRegistry instance(); synchronized Pluralizer register(Locale l, Pluralizer p); synchronized Pluralizer find(Locale l); synchronized Pluralizer getRegistered(Locale l); synchronized PluralizerRegistry copy(); static PluralizerRegistry INSTANCE; }