本文整理汇总了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());
}