Example usage for java.util Arrays hashCode

List of usage examples for java.util Arrays hashCode

Introduction

In this page you can find the example usage for java.util Arrays hashCode.

Prototype

public static int hashCode(Object a[]) 

Source Link

Document

Returns a hash code based on the contents of the specified array.

Usage

From source file:com.opengamma.analytics.financial.model.volatility.SmileAndBucketedSensitivities.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + Arrays.hashCode(_sensitivities);
    result = prime * result + _smile.hashCode();
    return result;
}

From source file:VASSAL.tools.HashCode.java

public static final int hash(final float[] a) {
    return Arrays.hashCode(a);
}

From source file:com.enonic.cms.core.portal.instruction.CreateResourceUrlInstruction.java

@Override
public int hashCode() {
    int result = resolvedPath != null ? resolvedPath.hashCode() : 0;
    result = 31 * result + (params != null ? Arrays.hashCode(params) : 0);
    return result;
}

From source file:HashCode.java

/**
 * Compute a combined hash code from the supplied objects using the supplied seed.
 * @param seed a value upon which the hash code will be based; may be 0
 * @param objects the objects that should be used to compute the hash code
 * @return the hash code/*  ww  w  .j ava  2 s .co m*/
 */
protected static int compute(int seed, Object... objects) {
    if (objects == null || objects.length == 0) {
        return seed * HashCode.PRIME;
    }
    // Compute the hash code for all of the objects ...
    int hc = seed;
    for (Object object : objects) {
        hc = HashCode.PRIME * hc;
        if (object instanceof byte[]) {
            hc += Arrays.hashCode((byte[]) object);
        } else if (object instanceof boolean[]) {
            hc += Arrays.hashCode((boolean[]) object);
        } else if (object instanceof short[]) {
            hc += Arrays.hashCode((short[]) object);
        } else if (object instanceof int[]) {
            hc += Arrays.hashCode((int[]) object);
        } else if (object instanceof long[]) {
            hc += Arrays.hashCode((long[]) object);
        } else if (object instanceof float[]) {
            hc += Arrays.hashCode((float[]) object);
        } else if (object instanceof double[]) {
            hc += Arrays.hashCode((double[]) object);
        } else if (object instanceof char[]) {
            hc += Arrays.hashCode((char[]) object);
        } else if (object instanceof Object[]) {
            hc += Arrays.hashCode((Object[]) object);
        } else if (object != null) {
            hc += object.hashCode();
        }
    }
    return hc;
}

From source file:org.echocat.jomon.resources.ResourceSupport.java

@Override
public int hashCode() {
    try {/*w w  w  .jav  a  2 s.  c  o m*/
        int result = Arrays.hashCode(getMd5());
        result = 37 * result + (int) getSize();
        return result;
    } catch (final Exception e) {
        throw new RuntimeException("Could not build hashCode.", e);
    }
}

From source file:VASSAL.tools.HashCode.java

public static final int hash(final double[] a) {
    return Arrays.hashCode(a);
}

From source file:org.polymap.rhei.batik.PanelIdentifier.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + Arrays.hashCode(id);
    return result;
}

From source file:VASSAL.tools.HashCode.java

public static final <T> int hash(final T[] a) {
    return Arrays.hashCode(a);
}

From source file:org.diorite.config.MethodSignature.java

public MethodSignature(String name, Class<?>[] arguments, Class<?> returnType) {
    this.name = name;
    this.arguments = arguments;
    this.returnType = returnType;

    this.hashCode = Objects.hash(this.name, this.returnType) + Arrays.hashCode(this.arguments);
}

From source file:eu.europa.esig.dss.Digest.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((algorithm == null) ? 0 : algorithm.hashCode());
    result = prime * result + Arrays.hashCode(value);
    return result;
}