本文整理匯總了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);
}