All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.carrotsearch.hppcrt.strategies.ObjectStandardHash Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 0.7.5
Show newest version
package com.carrotsearch.hppcrt.strategies;

import com.carrotsearch.hppcrt.Internals;
import com.carrotsearch.hppcrt.Intrinsics;

  
  
/**
 * Standard  {@link ObjectHashingStrategy} for KTypes, 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: ObjectStandardHash.java") 
public final class ObjectStandardHash implements ObjectHashingStrategy
{

    public ObjectStandardHash() {
        // nothing
    }

    @Override
    public int computeHashCode(final KType object) {

        return Internals.rehash(object);
    }

    @Override
    public boolean equals(final KType o1, final KType o2) {

        return (o1 == null ? o2 == null : o1.equals(o2));
    }

    @Override
    public boolean equals(final Object o) {

        if (o instanceof ObjectStandardHash) {

            return true;
        }

        return false;
    }

    @Override
    public int hashCode() {

        return System.identityHashCode(ObjectStandardHash.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy