本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.subtract方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.subtract方法的具体用法?Java ContainerUtil.subtract怎么用?Java ContainerUtil.subtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.subtract方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setVisible
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void setVisible(@NotNull VirtualFile root, boolean visible) {
Set<VirtualFile> roots = getAllRoots();
VcsLogFileFilter previousFilter = myFilterModel.getFilter();
VcsLogRootFilter rootFilter = previousFilter != null ? previousFilter.getRootFilter() : null;
Collection<VirtualFile> visibleRoots;
if (rootFilter == null) {
if (visible) {
visibleRoots = roots;
}
else {
visibleRoots = ContainerUtil.subtract(roots, Collections.singleton(root));
}
}
else {
if (visible) {
visibleRoots = ContainerUtil.union(new HashSet<VirtualFile>(rootFilter.getRoots()), Collections.singleton(root));
}
else {
visibleRoots = ContainerUtil.subtract(rootFilter.getRoots(), Collections.singleton(root));
}
}
myFilterModel.setFilter(new VcsLogFileFilter(null, new VcsLogRootFilterImpl(visibleRoots)));
}
示例2: convertToNodeIds
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Set<Integer> convertToNodeIds(@NotNull Collection<CommitId> commitIds, boolean reportNotFound) {
Set<Integer> result = ContainerUtil.newHashSet();
Set<CommitId> matchedIds = ContainerUtil.newHashSet();
for (int i = 0; i < myCommitIdIndexes.size(); i++) {
CommitId commitId = myCommitIdIndexes.get(i);
if (commitIds.contains(commitId)) {
result.add(i);
matchedIds.add(commitId);
}
}
if (reportNotFound) {
Collection<CommitId> unmatchedIds = ContainerUtil.subtract(commitIds, matchedIds);
if (!unmatchedIds.isEmpty()) {
LOG.error("Unmatched commit ids " + unmatchedIds);
}
}
for (Map.Entry<Integer, CommitId> entry : myNotLoadCommits.entrySet()) {
if (commitIds.contains(entry.getValue())) result.add(entry.getKey());
}
return result;
}
示例3: collectLabelsForRefs
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<String, Color> collectLabelsForRefs(@NotNull Collection<VcsRef> refs) {
if (refs.isEmpty()) {
return Collections.emptyMap();
}
VirtualFile root = refs.iterator().next().getRoot(); // all refs are from the same commit => they have the same root
refs = ContainerUtil.sorted(refs, myDataHolder.getLogProvider(root).getReferenceManager().getLabelsOrderComparator());
List<VcsRef> branches = getBranches(refs);
Collection<VcsRef> tags = ContainerUtil.subtract(refs, branches);
return getLabelsForRefs(branches, tags);
}