本文整理汇总了Java中com.google.common.collect.LinkedHashMultiset.add方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedHashMultiset.add方法的具体用法?Java LinkedHashMultiset.add怎么用?Java LinkedHashMultiset.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.LinkedHashMultiset
的用法示例。
在下文中一共展示了LinkedHashMultiset.add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectFilePaths
import com.google.common.collect.LinkedHashMultiset; //导入方法依赖的package包/类
/**
* Collect the file paths of the variation points of the selected elements.
*
* Each variation point is registered only once, even if several variants of the same variation
* point have been selected.
*
* @param selection
* The current selection
* @return The multi-set of variation point file paths.
*/
private LinkedHashMultiset<String> collectFilePaths(IStructuredSelection selection) {
LinkedHashMultiset<String> filePaths = LinkedHashMultiset.create();
Set<VariationPoint> vps = Sets.newLinkedHashSet();
for (Object selectedItem : selection.toList()) {
if (selectedItem instanceof Variant) {
vps.add(((Variant) selectedItem).getVariationPoint());
} else if (selectedItem instanceof VariationPoint) {
vps.add((VariationPoint) selectedItem);
}
}
for (VariationPoint vp : vps) {
if (vp != null) {
filePaths.add(getFile(vp));
}
}
return filePaths;
}
示例2: generateLinkedHashMultiset
import com.google.common.collect.LinkedHashMultiset; //导入方法依赖的package包/类
@Generates private static <E> LinkedHashMultiset<E> generateLinkedHashMultiset(E freshElement) {
LinkedHashMultiset<E> multiset = LinkedHashMultiset.create();
multiset.add(freshElement);
return multiset;
}
示例3: generateLinkedHashMultiset
import com.google.common.collect.LinkedHashMultiset; //导入方法依赖的package包/类
@Generates
private static <E> LinkedHashMultiset<E> generateLinkedHashMultiset(E freshElement) {
LinkedHashMultiset<E> multiset = LinkedHashMultiset.create();
multiset.add(freshElement);
return multiset;
}