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:org.obiba.mica.micaConfig.domain.OpalCredential.java

@Override
public int hashCode() {
    return Arrays.hashCode(new Object[] { getId(), getVersion(), authType, username, password });
}

From source file:org.eclipse.skalli.model.Expression.java

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

From source file:org.sonar.server.exceptions.Message.java

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

From source file:com.norconex.collector.http.robot.RobotsTxt.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + Float.floatToIntBits(crawlDelay);
    result = prime * result + Arrays.hashCode(filters);
    result = prime * result + Arrays.hashCode(sitemapLocations);
    return result;
}

From source file:org.marketcetera.saclient.SAClientParameters.java

@Override
public int hashCode() {
    return ObjectUtils.hashCode(mUsername) + Arrays.hashCode(mPassword) + Arrays.hashCode(contextClasses)
            + ObjectUtils.hashCode(mHostname) + ObjectUtils.hashCode(mPort) + ObjectUtils.hashCode(mURL);
}

From source file:com.jivesoftware.os.amza.api.ring.RingMember.java

@JsonCreator
public RingMember(@JsonProperty("member") String member) {
    this.memberAsBytes = member.getBytes(StandardCharsets.UTF_8);
    this.member = member;

    int hashCode = 7;
    hashCode = 73 * hashCode + Arrays.hashCode(this.memberAsBytes);
    this.hash = hashCode;
}

From source file:org.onehippo.repository.mock.MockBinary.java

public int hashCode() {
    if (hashCode == null) {
        hashCode = Integer.valueOf(Arrays.hashCode(data));
    }
    return hashCode;
}

From source file:com.opengamma.analytics.financial.credit.ISDAYieldCurveAndSpreadsProvider.java

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

From source file:com.samsung.sjs.backend.CBackend.java

/**
 * Returns a new ID for a new vtable, or the id of an existing
 * vtable if argument vt is identical to a previous vtable array.
 *///from  www  . j a v  a  2 s  . c  o m
protected int memo_vtable(int[] vt) {
    int result = -1;
    int hash = Arrays.hashCode(vt);
    int oldsize = vtables_by_hash.size();
    int oldsetsize = -1;
    boolean collision = false;
    if (vtables_by_hash.containsKey(hash)) {
        Set<Pair<int[], Integer>> possible_matches = vtables_by_hash.get(hash);
        assert (possible_matches != null);
        for (Pair<int[], Integer> test : possible_matches) {
            if (Arrays.equals(test.getKey(), vt)) {
                collision = true;
                result = test.getValue();
            }
        }
        if (!collision) {
            // We hit an existing has bucket, but don't match
            result = next_vtable_id++;
            Pair<int[], Integer> newpair = Pair.of(vt, result);
            oldsetsize = possible_matches.size();
            possible_matches.add(newpair);
            assert (possible_matches.size() > oldsetsize);
        }
    } else {
        // We don't match any existing bucket
        result = next_vtable_id++;
        Pair<int[], Integer> newpair = Pair.of(vt, result);
        Set<Pair<int[], Integer>> newset = new HashSet<Pair<int[], Integer>>();
        newset.add(newpair);
        vtables_by_hash.put(hash, newset);
        assert (vtables_by_hash.size() >= oldsize);
    }
    assert (result >= 0); // we initialize next_vtable_id to 0, so -1 is invalid
    return result;
}

From source file:com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance.java

@Override
public int hashCode() {
    return Arrays.hashCode(new Object[] { page });
}