本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.canonicalStrategy方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.canonicalStrategy方法的具体用法?Java ContainerUtil.canonicalStrategy怎么用?Java ContainerUtil.canonicalStrategy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.canonicalStrategy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWeakMap
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static <K,V> ConcurrentMap<K, V> createWeakMap() {
return new ConcurrentWeakKeySoftValueHashMap<K, V>(100, 0.75f, Runtime.getRuntime().availableProcessors(), ContainerUtil.<K>canonicalStrategy()){
@NotNull
@Override
protected ValueReference<K, V> createValueReference(@NotNull final V value,
@NotNull ReferenceQueue<V> queue) {
ValueReference<K, V> result;
if (value == NULL_RESULT || value instanceof Object[] && ((Object[])value).length == 0) {
// no use in creating SoftReference to null
result = createStrongReference(value);
}
else {
result = super.createValueReference(value, queue);
}
return result;
}
@Override
public V get(@NotNull Object key) {
V v = super.get(key);
return v == NULL_RESULT ? null : v;
}
};
}
示例2: uniqueResults
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static UniqueResultsQuery<PsiReference, ReferenceDescriptor> uniqueResults(@NotNull Query<PsiReference> composite) {
return new UniqueResultsQuery<PsiReference, ReferenceDescriptor>(composite, ContainerUtil.<ReferenceDescriptor>canonicalStrategy(), ReferenceDescriptor.MAPPER);
}
示例3: MyTHashMap
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public MyTHashMap() {
super(SystemInfo.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.<String>canonicalStrategy());
}
示例4: UniqueResultsQuery
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public UniqueResultsQuery(@NotNull Query<T> original) {
this(original, ContainerUtil.<M>canonicalStrategy(), (Function<T, M>)FunctionUtil.<M>id());
}
示例5: UniqueProcessor
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public UniqueProcessor(@NotNull Processor<T> delegate) {
this(delegate, ContainerUtil.<T>canonicalStrategy());
}
示例6: create
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static TObjectHashingStrategy<String> create(boolean caseSensitive) {
return caseSensitive ? ContainerUtil.<String>canonicalStrategy() : CaseInsensitiveStringHashingStrategy.INSTANCE;
}
示例7: uniqueResults
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static Query<PsiReference> uniqueResults(@NotNull Query<PsiReference> composite) {
return new UniqueResultsQuery<PsiReference, ReferenceDescriptor>(composite, ContainerUtil.<ReferenceDescriptor>canonicalStrategy(), ReferenceDescriptor.MAPPER);
}