本文整理汇总了Java中gnu.trove.TObjectHashingStrategy.equals方法的典型用法代码示例。如果您正苦于以下问题:Java TObjectHashingStrategy.equals方法的具体用法?Java TObjectHashingStrategy.equals怎么用?Java TObjectHashingStrategy.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TObjectHashingStrategy
的用法示例。
在下文中一共展示了TObjectHashingStrategy.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
});
}
示例2: 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());
}
};
}
示例3: isEqual
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
private static <K> boolean isEqual(@NotNull K key1, K key2, @NotNull TObjectHashingStrategy<K> hashingStrategy) {
return key1 == key2 || key2 != null && hashingStrategy.equals(key1, key2);
}
示例4: keyEqual
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
static <K> boolean keyEqual(K k1, K k2, TObjectHashingStrategy<K> strategy) {
return k1 == k2 || strategy.equals(k1, k2);
}
示例5: isEqual
import gnu.trove.TObjectHashingStrategy; //导入方法依赖的package包/类
private static <K> boolean isEqual(@Nonnull K key1, K key2, @Nonnull TObjectHashingStrategy<K> hashingStrategy) {
return key1 == key2 || key2 != null && hashingStrategy.equals(key1, key2);
}