本文整理汇总了Java中gnu.trove.TObjectHashingStrategy.computeHashCode方法的典型用法代码示例。如果您正苦于以下问题:Java TObjectHashingStrategy.computeHashCode方法的具体用法?Java TObjectHashingStrategy.computeHashCode怎么用?Java TObjectHashingStrategy.computeHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TObjectHashingStrategy
的用法示例。
在下文中一共展示了TObjectHashingStrategy.computeHashCode方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WeakKey
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
WeakKey(@NotNull K k,
@NotNull ValueReference<K, V> valueReference,
@NotNull TObjectHashingStrategy<K> strategy,
@NotNull ReferenceQueue<K> queue) {
super(k, queue);
myValueReference = valueReference;
myHash = strategy.computeHashCode(k);
myStrategy = strategy;
}
示例2: RefHashMap
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
public RefHashMap(@NotNull final TObjectHashingStrategy<K> hashingStrategy) {
this(4, 0.8f, new TObjectHashingStrategy<Key<K>>() {
@Override
public int computeHashCode(final Key<K> object) {
return hashingStrategy.computeHashCode(object.get());
}
@Override
public boolean equals(final Key<K> o1, final Key<K> o2) {
return hashingStrategy.equals(o1.get(), o2.get());
}
});
}
示例3: convertKToKeyK
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
@NotNull
private static <K,V> TObjectHashingStrategy<Key<K, V>> convertKToKeyK(@NotNull final TObjectHashingStrategy<K> hashingStrategy) {
return new TObjectHashingStrategy<Key<K, V>>() {
@Override
public int computeHashCode(final Key<K, V> object) {
return hashingStrategy.computeHashCode(object.get());
}
@Override
public boolean equals(final Key<K, V> o1, final Key<K, V> o2) {
return hashingStrategy.equals(o1.get(), o2.get());
}
};
}
示例4: SoftKey
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
SoftKey(@Nonnull K k,
@Nonnull ValueReference<K, V> valueReference,
@Nonnull TObjectHashingStrategy<K> strategy,
@Nonnull ReferenceQueue<K> queue) {
super(k, queue);
myValueReference = valueReference;
myHash = strategy.computeHashCode(k);
myStrategy = strategy;
}
示例5: WeakKey
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
WeakKey(@Nonnull K k,
@Nonnull ValueReference<K, V> valueReference,
@Nonnull TObjectHashingStrategy<K> strategy,
@Nonnull ReferenceQueue<K> queue) {
super(k, queue);
myValueReference = valueReference;
myHash = strategy.computeHashCode(k);
myStrategy = strategy;
}
示例6: createKeyReference
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
@Override
protected KeyReference<K, V> createKeyReference(@NotNull K key, @NotNull V value, @NotNull TObjectHashingStrategy<K> hashingStrategy) {
return new SoftKey<K, V>(key, hashingStrategy.computeHashCode(key), hashingStrategy, value, myReferenceQueue);
}
示例7: createKeyReference
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
@Override
protected KeyReference<K, V> createKeyReference(@NotNull K key, @NotNull V value, @NotNull TObjectHashingStrategy<K> hashingStrategy) {
return new WeakKey<K, V>(key, hashingStrategy.computeHashCode(key), hashingStrategy, value, myReferenceQueue);
}
示例8: createKeyReference
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
@Override
protected KeyReference<K, V> createKeyReference(@Nonnull K key, @Nonnull V value, @Nonnull TObjectHashingStrategy<K> hashingStrategy) {
return new SoftKey<K, V>(key, hashingStrategy.computeHashCode(key), hashingStrategy, value, myReferenceQueue);
}
示例9: WeakKey
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
private WeakKey(@Nonnull T k, @Nonnull TObjectHashingStrategy<T> strategy, @Nonnull ReferenceQueue<? super T> q) {
super(k, q);
myStrategy = strategy;
myHash = strategy.computeHashCode(k);
}
示例10: createKeyReference
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
@Override
protected KeyReference<K, V> createKeyReference(@Nonnull K key, @Nonnull V value, @Nonnull TObjectHashingStrategy<K> hashingStrategy) {
return new WeakKey<K, V>(key, hashingStrategy.computeHashCode(key), hashingStrategy, value, myReferenceQueue);
}
示例11: SoftKey
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
private SoftKey(@Nonnull T k, @Nonnull TObjectHashingStrategy<T> strategy, @Nonnull ReferenceQueue<? super T> q) {
super(k, q);
myStrategy = strategy;
myHash = strategy.computeHashCode(k);
}