本文整理匯總了Java中com.google.common.collect.Multimap.size方法的典型用法代碼示例。如果您正苦於以下問題:Java Multimap.size方法的具體用法?Java Multimap.size怎麽用?Java Multimap.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.collect.Multimap
的用法示例。
在下文中一共展示了Multimap.size方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testDifferenceInRenameTabs
import com.google.common.collect.Multimap; //導入方法依賴的package包/類
public void testDifferenceInRenameTabs() throws Exception {
StringBuilder diffs = new StringBuilder();
for (HumanLanguage language : LanguageProviderFactory.get().getAll()) {
if (!LanguageDeclensionFactory.get().getDeclension(language).hasPlural()) continue;
LanguageDictionary dictionary = loadDictionary(language);
Multimap<String,String> nowHasPlural = TreeMultimap.create();
Multimap<String,String> missingPlural = TreeMultimap.create();
for (String entity : new TreeSet<String>(dictionary.getNounsByEntity().keySet())) {
for (Noun n : dictionary.getNounsByEntity().get(entity)) {
if (n.getNounType() == NounType.ENTITY) continue;
boolean hasPluralForm = false;
for (NounForm form : n.getAllDefinedValues().keySet()) {
if (form.getNumber() == LanguageNumber.PLURAL && form.getCase() == LanguageCase.NOMINATIVE) {
hasPluralForm = true;
break;
}
}
if (hasPluralForm != (n.getNounType() == NounType.FIELD)) {
if (hasPluralForm) {
nowHasPlural.put(entity, n.getName());
} else {
missingPlural.put(entity, n.getName());
}
}
}
}
if (nowHasPlural.size() > 0) {
diffs.append(language).append(" can rename plural fields for: ").append(nowHasPlural).append('\n');
}
if (missingPlural.size() > 0) {
diffs.append(language).append(" has these plural fields removed for rename: ").append(missingPlural).append('\n');
}
}
System.out.println(diffs.toString());
}