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.instrument.inflation.CouponInflationZeroCouponInterpolationGearingDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    long temp;/*from   www .  j  av  a2 s  . c om*/
    temp = Double.doubleToLongBits(_factor);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _fixingEndDate.hashCode();
    temp = Double.doubleToLongBits(_indexStartValue);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + (_payNotional ? 1231 : 1237);
    result = prime * result + Arrays.hashCode(_referenceEndDate);
    result = prime * result + _referenceStartDate.hashCode();
    temp = Double.doubleToLongBits(_weight);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.gigaspaces.persistency.metadata.DefaultSpaceDocumentMapper.java

public Object toObject(Object property) {
    if (property == null)
        return null;

    switch (type(property.getClass())) {

    case TYPE_CHAR:
    case TYPE_FLOAT:
    case TYPE_BYTE:
    case TYPE_BIGDECIMAL:
    case TYPE_BIGINT:
        return toSpecialType(property);
    case TYPE_OBJECT:
        if (property instanceof SpaceDocument)
            return toDBObject((SpaceDocument) property);
        else if (property instanceof Class)
            return toSpecialType(property);
        else if (property instanceof Locale)
            return toSpecialType(property);
        else if (property instanceof URI)
            return toSpecialType(property);
        else if (property instanceof Timestamp)
            return toSpecialType(property);

        if (!(property instanceof Serializable))
            return toDBObject(property);

        byte[] result = serializeObject(property);

        BasicDBObjectBuilder blob = BasicDBObjectBuilder.start();

        blob.add(Constants.TYPE, Constants.CUSTOM_BINARY);

        blob.add(Constants.VALUE, result);

        blob.add(Constants.HASH, Arrays.hashCode(result));

        return blob.get();
    case TYPE_ENUM:
        return toEnum(property);
    case TYPE_ARRAY:
        return toArray(property);
    case TYPE_COLLECTION:
        return toCollection(property);
    case TYPE_MAP:
        return toMap(property);
    default:/*  w w w. j a  v  a2s. co m*/
        return property;
    }
}

From source file:org.protempa.dest.table.Reference.java

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

From source file:org.lockss.exporter.biblio.BibliographicItemAdapter.java

@Override
public int hashCode() {
    int result = printIsbn != null ? printIsbn.hashCode() : 0;
    result = 31 * result + (eIsbn != null ? eIsbn.hashCode() : 0);
    result = 31 * result + (printIssn != null ? printIssn.hashCode() : 0);
    result = 31 * result + (eIssn != null ? eIssn.hashCode() : 0);
    result = 31 * result + (issnL != null ? issnL.hashCode() : 0);
    result = 31 * result + (publicationTitle != null ? publicationTitle.hashCode() : 0);
    result = 31 * result + (seriesTitle != null ? seriesTitle.hashCode() : 0);
    result = 31 * result + (proprietaryIds != null ? Arrays.hashCode(proprietaryIds) : 0);
    result = 31 * result + (proprietarySeriesIds != null ? Arrays.hashCode(proprietarySeriesIds) : 0);
    result = 31 * result + (providerName != null ? providerName.hashCode() : 0);
    result = 31 * result + (publisherName != null ? publisherName.hashCode() : 0);
    result = 31 * result + (name != null ? name.hashCode() : 0);
    result = 31 * result + (volume != null ? volume.hashCode() : 0);
    result = 31 * result + (year != null ? year.hashCode() : 0);
    result = 31 * result + (issue != null ? issue.hashCode() : 0);
    result = 31 * result + (startVolume != null ? startVolume.hashCode() : 0);
    result = 31 * result + (endVolume != null ? endVolume.hashCode() : 0);
    result = 31 * result + (startYear != null ? startYear.hashCode() : 0);
    result = 31 * result + (endYear != null ? endYear.hashCode() : 0);
    result = 31 * result + (startIssue != null ? startIssue.hashCode() : 0);
    result = 31 * result + (endIssue != null ? endIssue.hashCode() : 0);
    result = 31 * result + (publicationType != null ? publicationType.hashCode() : 0);
    result = 31 * result + (coverageDepth != null ? coverageDepth.hashCode() : 0);
    return result;
}

From source file:org.languagetool.AnalyzedTokenReadings.java

@Override
public int hashCode() {
    return Arrays.hashCode(anTokReadings) + Objects.hash(isLinebreak, isParaEnd, isSentEnd, isSentStart,
            isWhitespace, isWhitespaceBefore, chunkTags, startPos, token);
}

From source file:org.protempa.dest.table.PropositionColumnSpec.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((columnNamePrefixOverride == null) ? 0 : columnNamePrefixOverride.hashCode());
    result = prime * result + Arrays.hashCode(links);
    result = prime * result + numInstances;
    result = prime * result + ((outputConfig == null) ? 0 : outputConfig.hashCode());
    result = prime * result + Arrays.hashCode(propertyNames);
    result = prime * result + ((valueOutputConfig == null) ? 0 : valueOutputConfig.hashCode());
    return result;
}

From source file:com.opengamma.analytics.financial.credit.creditdefaultswap.pricing.vanilla.isdanew.ISDACompliantCurve.java

@Override
public int hashCode() {
    int result;//w  w w  . ja va  2 s . co  m
    long temp;
    result = _n;
    result = 31 * result + (_t != null ? Arrays.hashCode(_t) : 0);
    result = 31 * result + (_r != null ? Arrays.hashCode(_r) : 0);
    result = 31 * result + (_rt != null ? Arrays.hashCode(_rt) : 0);
    result = 31 * result + (_df != null ? Arrays.hashCode(_df) : 0);
    temp = Double.doubleToLongBits(_offsetTime);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_offsetRT);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.instrument.inflation.CapFloorInflationZeroCouponInterpolationDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    result = prime * result + _conventionalMonthLag;
    result = prime * result + (_isCap ? 1231 : 1237);
    result = prime * result + ((_lastKnownFixingDate == null) ? 0 : _lastKnownFixingDate.hashCode());
    result = prime * result + _maturity;
    result = prime * result + _monthLag;
    result = prime * result + Arrays.hashCode(_referenceEndDates);
    result = prime * result + ((_referenceStartDates == null) ? 0 : _referenceStartDates.hashCode());
    long temp;//from   ww w .  j a  va2  s  .  c  om
    temp = Double.doubleToLongBits(_strike);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_weight);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:org.kie.commons.java.nio.base.AbstractPath.java

@Override
public int hashCode() {
    int result = fs != null ? fs.hashCode() : 0;
    result = 31 * result + (usesWindowsFormat ? 1 : 0);
    result = 31 * result + (isAbsolute ? 1 : 0);

    if (!usesWindowsFormat) {
        result = 31 * result + (path != null ? Arrays.hashCode(path) : 0);
    } else {//from w  w w  . j  a v  a2 s.  c om
        result = 31 * result + (path != null ? new String(path).toLowerCase().hashCode() : 0);
    }

    result = 31 * result + (isRoot ? 1 : 0);
    result = 31 * result + (isRealPath ? 1 : 0);
    result = 31 * result + (isNormalized ? 1 : 0);
    return result;
}

From source file:com.opengamma.analytics.financial.instrument.payment.CouponIborCompoundedDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    result = prime * result + Arrays.hashCode(_accrualEndDates);
    result = prime * result + Arrays.hashCode(_accrualStartDates);
    result = prime * result + Arrays.hashCode(_fixingDates);
    result = prime * result + Arrays.hashCode(_fixingPeriodAccrualFactors);
    result = prime * result + Arrays.hashCode(_fixingPeriodEndDates);
    result = prime * result + Arrays.hashCode(_fixingPeriodStartDates);
    result = prime * result + _index.hashCode();
    result = prime * result + Arrays.hashCode(_paymentAccrualFactors);
    return result;
}