com.carrotsearch.hppcrt.strategies.FloatStandardHash Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hppcrt Show documentation
Show all versions of hppcrt Show documentation
High Performance Primitive Collections Realtime
(fork of HPPC of Carrotsearch)
Fundamental data structures (maps, sets, lists, stacks, queues, heaps, sorts) generated for
combinations of object and primitive types to conserve JVM memory and speed
up execution. The Realtime fork intend of extending collections while tweaking and optimizations to remove any dynamic allocations at runtime,
and low variance execution times.
package com.carrotsearch.hppcrt.strategies;
import com.carrotsearch.hppcrt.Internals;
import com.carrotsearch.hppcrt.Intrinsics;
/**
* Standard {@link FloatHashingStrategy} for float
s, providing the same behavior as equals()/ hashCode()
* gives for objects.
*/
@javax.annotation.Generated(date = "2015-02-27T19:21:18+0100", value = "HPPC-RT generated from: FloatStandardHash.java")
public final class FloatStandardHash implements FloatHashingStrategy
{
public FloatStandardHash() {
// nothing
}
@Override
public int computeHashCode(final float object) {
return Internals.rehash(object);
}
@Override
public boolean equals(final float o1, final float o2) {
return (Float.floatToIntBits(o1) == Float.floatToIntBits(o2));
}
@Override
public boolean equals(final Object o) {
if (o instanceof FloatStandardHash) {
return true;
}
return false;
}
@Override
public int hashCode() {
return System.identityHashCode(FloatStandardHash.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy