com.intellij.psi.PsiArrayType#gnu.trove.TObjectHashingStrategy源码实例Demo

下面列出了com.intellij.psi.PsiArrayType#gnu.trove.TObjectHashingStrategy 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: consulo   文件: MultiMap.java
@Nonnull
public static <K, V> MultiMap<K, V> createSet(final TObjectHashingStrategy strategy) {
  return new MultiMap<K, V>() {
    @Nonnull
    @Override
    protected Collection<V> createCollection() {
      return new SmartHashSet<V>();
    }

    @Nonnull
    @Override
    protected Collection<V> createEmptyCollection() {
      return Collections.emptySet();
    }

    @Nonnull
    @Override
    protected Map<K, Collection<V>> createMap() {
      return new THashMap<K, Collection<V>>(strategy);
    }
  };
}
 
源代码2 项目: consulo   文件: RefreshWorker.java
private void processQueue(@Nonnull NewVirtualFileSystem fs, @Nonnull PersistentFS persistence) throws RefreshCancelledException {
  TObjectHashingStrategy<String> strategy = FilePathHashingStrategy.create(fs.isCaseSensitive());

  next:
  while (!myRefreshQueue.isEmpty()) {
    VirtualDirectoryImpl dir = (VirtualDirectoryImpl)myRefreshQueue.pullFirst();
    boolean fullSync = dir.allChildrenLoaded(), succeeded;

    do {
      myHelper.beginTransaction();
      try {
        succeeded = fullSync ? fullDirRefresh(fs, persistence, strategy, dir) : partialDirRefresh(fs, persistence, strategy, dir);
      }
      catch (InvalidVirtualFileAccessException e) {
        myHelper.endTransaction(false);
        continue next;
      }
      myHelper.endTransaction(succeeded);
      if (!succeeded && LOG.isTraceEnabled()) LOG.trace("retry: " + dir);
    }
    while (!succeeded);

    if (myIsRecursive) {
      dir.markClean();
    }
  }
}
 
源代码3 项目: consulo   文件: ObjectStubTree.java
@Override
public void occurrence(@Nonnull final StubIndexKey indexKey, @Nonnull final Object value) {
  Map<Object, int[]> map = myResult.get(indexKey);
  if (map == null) {
    map = new THashMap<>((TObjectHashingStrategy<Object>)myHashingStrategyFunction.fun(indexKey));
    myResult.put(indexKey, map);
  }

  int[] list = map.get(value);
  if (list == null) {
    map.put(value, new int[]{myStubIdx});
  }
  else {
    int lastNonZero = ArrayUtil.lastIndexOfNot(list, 0);
    if (lastNonZero >= 0 && list[lastNonZero] == myStubIdx) {
      // second and subsequent occurrence calls for the same value are no op
      return;
    }
    int lastZero = lastNonZero + 1;

    if (lastZero == list.length) {
      list = ArrayUtil.realloc(list, Math.max(4, list.length << 1));
      map.put(value, list);
    }
    list[lastZero] = myStubIdx;
  }
}
 
源代码4 项目: consulo   文件: MultiMap.java
@Nonnull
public static <K, V> MultiMap<K, V> create(@Nonnull final TObjectHashingStrategy<K> strategy) {
  return new MultiMap<K, V>() {
    @Nonnull
    @Override
    protected Map<K, Collection<V>> createMap() {
      return new THashMap<K, Collection<V>>(strategy);
    }
  };
}
 
源代码5 项目: semafor-semantic-parser   文件: Counter.java
public Counter(TObjectHashingStrategy<T> hs) {
	m_map = new TObjectDoubleHashMap<T>(hs);
}
 
源代码6 项目: semafor-semantic-parser   文件: IntCounter.java
public IntCounter(TObjectHashingStrategy<T> hs) {
	m_map = new TObjectIntHashMap<T>(hs);
}
 
public SingleAssignmentHashMap(TObjectHashingStrategy<K> hashingStrategy) {
	this(hashingStrategy, ReassignmentPolicy.ERROR);
}
 
public SingleAssignmentHashMap(TObjectHashingStrategy<K> hashingStrategy, ReassignmentPolicy reassign) {
	super(hashingStrategy);
}
 
public FactoryDefaultMap(DefaultValueFactory<V> factory, TObjectHashingStrategy<K> hashingStrategy) {
	super(hashingStrategy);
	this.factory = factory;
}
 
源代码10 项目: bluima   文件: TObjectIndexHashMap.java
public TObjectIndexHashMap(TObjectHashingStrategy arg0) {
  super(arg0);
}
 
源代码11 项目: bluima   文件: TObjectIndexHashMap.java
public TObjectIndexHashMap(int arg0, float arg1, TObjectHashingStrategy arg2) {
  super(arg0, arg1, arg2);
}
 
源代码12 项目: bluima   文件: TObjectIndexHashMap.java
public TObjectIndexHashMap(int arg0, TObjectHashingStrategy arg1) {
  super(arg0, arg1);
}
 
源代码13 项目: consulo   文件: OpenTHashSet.java
public OpenTHashSet(final TObjectHashingStrategy<T> strategy, final T... ts) {
  super(Arrays.asList(ts), strategy);
}
 
源代码14 项目: consulo   文件: UniqueResultsQuery.java
public UniqueResultsQuery(@Nonnull Query<? extends T> original, @Nonnull TObjectHashingStrategy<? super M> hashingStrategy, @Nonnull Function<? super T, ? extends M> mapper) {
  myOriginal = original;
  myHashingStrategy = hashingStrategy;
  myMapper = mapper;
}
 
源代码15 项目: consulo   文件: SingletonSet.java
@Nonnull
public static <T> Set<T> withCustomStrategy(T o, @Nonnull TObjectHashingStrategy<T> strategy) {
  return new CustomStrategySingletonSet<T>(o, strategy);
}
 
源代码16 项目: consulo   文件: FilePathHashingStrategy.java
@Nonnull
public static TObjectHashingStrategy<String> create(boolean caseSensitive) {
  return caseSensitive ? ContainerUtil.canonicalStrategy() : CaseInsensitiveStringHashingStrategy.INSTANCE;
}
 
源代码17 项目: consulo   文件: LocalFileSystemRefreshWorker.java
RefreshContext(@Nonnull NewVirtualFileSystem fs, @Nonnull PersistentFS persistence, @Nonnull TObjectHashingStrategy<String> strategy) {
  this.fs = fs;
  this.persistence = persistence;
  this.strategy = strategy;
}
 
源代码18 项目: consulo   文件: LocalFileSystemRefreshWorker.java
SequentialRefreshContext(@Nonnull NewVirtualFileSystem fs, @Nonnull PersistentFS persistentFS, @Nonnull TObjectHashingStrategy<String> strategy) {
  super(fs, persistentFS, strategy);
}
 
源代码19 项目: consulo   文件: LocalFileSystemRefreshWorker.java
ConcurrentRefreshContext(@Nonnull NewVirtualFileSystem fs, @Nonnull PersistentFS persistentFS, @Nonnull TObjectHashingStrategy<String> strategy, int parallelism) {
  super(fs, persistentFS, strategy);
  service = AppExecutorUtil.createBoundedApplicationPoolExecutor("Refresh Worker", parallelism);
}
 
源代码20 项目: consulo   文件: ConcurrentCollectionFactory.java
@Nonnull
@Contract(pure = true)
public static <T, V> ConcurrentMap<T, V> createMap(@Nonnull TObjectHashingStrategy<T> hashStrategy) {
  return new ConcurrentHashMap<>(hashStrategy);
}
 
源代码21 项目: consulo   文件: ObjectStubTree.java
private StubIndexSink(@Nonnull Function<StubIndexKey<?, ?>, TObjectHashingStrategy<?>> hashingStrategyFunction) {
  myHashingStrategyFunction = hashingStrategyFunction;
}
 
源代码22 项目: consulo   文件: ConcurrentCollectionFactory.java
@Nonnull
@Contract(pure = true)
public static <T> Set<T> createConcurrentSet(@Nonnull TObjectHashingStrategy<T> hashStrategy) {
  return Collections.newSetFromMap(createMap(hashStrategy));
}
 
源代码23 项目: consulo   文件: ConcurrentSoftHashMap.java
ConcurrentSoftHashMap(int initialCapacity, float loadFactor, int concurrencyLevel, @Nonnull TObjectHashingStrategy<? super K> hashingStrategy) {
  super(initialCapacity, loadFactor, concurrencyLevel, hashingStrategy);
}
 
源代码24 项目: consulo   文件: ConcurrentSoftHashMap.java
private SoftKey(@Nonnull K k, final int hash, @Nonnull TObjectHashingStrategy<? super K> strategy, @Nonnull ReferenceQueue<K> q) {
  super(k, q);
  myStrategy = strategy;
  myHash = hash;
}
 
源代码25 项目: consulo   文件: SmartHashSet.java
public SmartHashSet(Collection<? extends T> collection, TObjectHashingStrategy<T> strategy) {
  super(collection, strategy);
}
 
源代码26 项目: consulo   文件: WeakHashMap.java
WeakHashMap(int initialCapacity, float loadFactor, @Nonnull TObjectHashingStrategy<? super K> strategy) {
  super(initialCapacity, loadFactor, strategy);
}
 
源代码27 项目: consulo   文件: ObjectStubTree.java
@Deprecated
@Nonnull
public Map<StubIndexKey, Map<Object, int[]>> indexStubTree() {
  return indexStubTree(key -> TObjectHashingStrategy.CANONICAL);
}
 
源代码28 项目: consulo   文件: WeakHashMap.java
private WeakKey(@Nonnull T k, @Nonnull TObjectHashingStrategy<? super T> strategy, @Nonnull ReferenceQueue<? super T> q) {
  super(k, q);
  myStrategy = strategy;
  myHash = strategy.computeHashCode(k);
}
 
源代码29 项目: consulo   文件: ConcurrentWeakHashMap.java
private WeakKey(@Nonnull K k, final int hash, @Nonnull TObjectHashingStrategy<? super K> strategy, @Nonnull ReferenceQueue<K> q) {
  super(k, q);
  myStrategy = strategy;
  myHash = hash;
}
 
源代码30 项目: consulo   文件: ConcurrentWeakHashMap.java
@Nonnull
@Override
protected KeyReference<K> createKeyReference(@Nonnull K key, @Nonnull TObjectHashingStrategy<? super K> hashingStrategy) {
  return new WeakKey<>(key, hashingStrategy.computeHashCode(key), hashingStrategy, myReferenceQueue);
}