本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.newIdentityTroveSet方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.newIdentityTroveSet方法的具体用法?Java ContainerUtil.newIdentityTroveSet怎么用?Java ContainerUtil.newIdentityTroveSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.newIdentityTroveSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trimToLimit
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void trimToLimit(Lookup lookup, ProcessingContext context) {
if (myItems.size() <= myLimit * 2) return;
List<LookupElement> items = getMatchingItems();
Iterator<LookupElement> iterator = sortByRelevance(groupItemsBySorter(items)).iterator();
final Set<LookupElement> retainedSet = ContainerUtil.newIdentityTroveSet();
retainedSet.addAll(getPrefixItems(true));
retainedSet.addAll(getPrefixItems(false));
retainedSet.addAll(myFrozenItems);
while (retainedSet.size() < myLimit && iterator.hasNext()) {
retainedSet.add(iterator.next());
}
if (!iterator.hasNext()) return;
List<LookupElement> removed = retainItems(retainedSet, lookup);
for (LookupElement element : removed) {
removeItem(element, context);
}
if (!myOverflow) {
myOverflow = true;
myProcess.addAdvertisement("Not all variants are shown, please type more letters to see the rest", null);
// restart completion on any prefix change
myProcess.addWatchedPrefix(0, StandardPatterns.string());
}
}
示例2: addType
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void addType(PsiClass clazz) {
if (myTypes == null) {
//noinspection unchecked
myTypes = ContainerUtil.<PsiClass>newIdentityTroveSet(2);
}
myTypes.add(clazz);
}
示例3: purgeInvalidHighlighters
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "RawUseOfParameterizedType"})
private static boolean purgeInvalidHighlighters(Editor editor, List<RangeHighlighter> hl) {
final Set set = ContainerUtil.newIdentityTroveSet(Arrays.asList(editor.getMarkupModel().getAllHighlighters()));
boolean hasHighlighter = false;
for (Iterator<RangeHighlighter> iterator = hl.iterator(); iterator.hasNext();) {
final RangeHighlighter h = iterator.next();
if (!h.isValid() || !set.contains(h)) {
iterator.remove();
} else {
hasHighlighter = true;
}
}
return hasHighlighter;
}
示例4: createInstance
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked" })
public THashSet<DPattern> createInstance() {
return ContainerUtil.<DPattern>newIdentityTroveSet(256);
}