Example usage for java.lang Double doubleToLongBits

List of usage examples for java.lang Double doubleToLongBits

Introduction

In this page you can find the example usage for java.lang Double doubleToLongBits.

Prototype

@HotSpotIntrinsicCandidate
public static long doubleToLongBits(double value) 

Source Link

Document

Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.

Usage

From source file:com.opengamma.analytics.financial.instrument.bond.BondTransactionDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//from  www .  j  a  v  a  2  s  .co m
    temp = Double.doubleToLongBits(_price);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_quantity);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _settlementDate.hashCode();
    result = prime * result + _underlyingBond.hashCode();
    return result;
}

From source file:com.milaboratory.core.tree.TreeSearchParameters.java

@Override
public int hashCode() {
    int result;/* w w  w .  j  ava 2s. c  o  m*/
    long temp;
    result = Arrays.hashCode(maxErrors);
    result = 31 * result + Arrays.hashCode(penalty);
    temp = Double.doubleToLongBits(maxPenalty);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//  ww w  .  ja va 2s . c om
    if (!super.equals(obj)) {
        return false;
    }
    final SwaptionPhysicalFixedIbor other = (SwaptionPhysicalFixedIbor) obj;
    if (_isLong != other._isLong) {
        return false;
    }
    if (Double.doubleToLongBits(_settlementTime) != Double.doubleToLongBits(other._settlementTime)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingSwap, other._underlyingSwap)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CouponArithmeticAverageONSpreadSimplified.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from ww  w .  j ava  2 s  .  c  om*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    CouponArithmeticAverageONSpreadSimplified other = (CouponArithmeticAverageONSpreadSimplified) obj;
    if (Double.doubleToLongBits(_fixingPeriodEndTime) != Double.doubleToLongBits(other._fixingPeriodEndTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_fixingPeriodStartTime) != Double
            .doubleToLongBits(other._fixingPeriodStartTime)) {
        return false;
    }
    if (!ObjectUtils.equals(_index, other._index)) {
        return false;
    }
    if (Double.doubleToLongBits(_spread) != Double.doubleToLongBits(other._spread)) {
        return false;
    }
    if (Double.doubleToLongBits(_spreadAmount) != Double.doubleToLongBits(other._spreadAmount)) {
        return false;
    }
    return true;
}

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

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    long temp;/*from  ww w . j  a va  2 s. c  o  m*/
    temp = Double.doubleToLongBits(_amount);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_rate);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:Utilities.java

/**
 * Returns a hash code for the specified double value.
 *//*from ww  w  .  j  av  a 2  s  .  c  om*/

public static int hashCode(double val) {
    return hashCode(Double.doubleToLongBits(val));
}

From source file:com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from  w w  w  . j  a v  a2 s . c o m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final InterestRateFutureOptionMarginSecurity other = (InterestRateFutureOptionMarginSecurity) obj;
    if (!ObjectUtils.equals(_discountingCurveName, other._discountingCurveName)) {
        return false;
    }
    if (Double.doubleToLongBits(_expirationTime) != Double.doubleToLongBits(other._expirationTime)) {
        return false;
    }
    if (!ObjectUtils.equals(_forwardCurveName, other._forwardCurveName)) {
        return false;
    }
    if (_isCall != other._isCall) {
        return false;
    }
    if (Double.doubleToLongBits(_strike) != Double.doubleToLongBits(other._strike)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingFuture, other._underlyingFuture)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.instrument.bond.BondFixedTransactionDefinition.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from   w ww .java  2s  .c  om
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BondFixedTransactionDefinition other = (BondFixedTransactionDefinition) obj;
    if (Double.doubleToLongBits(_accruedInterestAtSettlement) != Double
            .doubleToLongBits(other._accruedInterestAtSettlement)) {
        return false;
    }
    return true;
}

From source file:com.controller.model.ProductShipment.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*  w w  w  . jav  a 2s. c o  m*/
    if (obj == null) {
        return false;
    }
    if (!(obj instanceof ProductShipment)) {
        return false;
    }
    ProductShipment other = (ProductShipment) obj;
    if (Double.doubleToLongBits(shipmentAmount) != Double.doubleToLongBits(other.shipmentAmount)) {
        return false;
    }
    if (shipmentAmountCurrency == null) {
        if (other.shipmentAmountCurrency != null) {
            return false;
        }
    } else if (!shipmentAmountCurrency.equals(other.shipmentAmountCurrency)) {
        return false;
    }
    if (Double.doubleToLongBits(shipmentInsuranceAmount) != Double
            .doubleToLongBits(other.shipmentInsuranceAmount)) {
        return false;
    }
    if (shipmentInsuranceAmountCurrency == null) {
        if (other.shipmentInsuranceAmountCurrency != null) {
            return false;
        }
    } else if (!shipmentInsuranceAmountCurrency.equals(other.shipmentInsuranceAmountCurrency)) {
        return false;
    }
    if (shipmentProvider == null) {
        if (other.shipmentProvider != null) {
            return false;
        }
    } else if (!shipmentProvider.equals(other.shipmentProvider)) {
        return false;
    }
    if (shipmentProviderDurationTerms == null) {
        if (other.shipmentProviderDurationTerms != null) {
            return false;
        }
    } else if (!shipmentProviderDurationTerms.equals(other.shipmentProviderDurationTerms)) {
        return false;
    }
    if (shipmentProviderImage200 == null) {
        if (other.shipmentProviderImage200 != null) {
            return false;
        }
    } else if (!shipmentProviderImage200.equals(other.shipmentProviderImage200)) {
        return false;
    }
    if (shipmentProviderImage75 == null) {
        if (other.shipmentProviderImage75 != null) {
            return false;
        }
    } else if (!shipmentProviderImage75.equals(other.shipmentProviderImage75)) {
        return false;
    }
    if (shipmentProviderServiceLevelName == null) {
        if (other.shipmentProviderServiceLevelName != null) {
            return false;
        }
    } else if (!shipmentProviderServiceLevelName.equals(other.shipmentProviderServiceLevelName)) {
        return false;
    }
    if (shipmentReferenceId == null) {
        if (other.shipmentReferenceId != null) {
            return false;
        }
    } else if (!shipmentReferenceId.equals(other.shipmentReferenceId)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.interestrate.bond.definition.BondFixedSecurity.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    long temp;//from www .j av a 2 s .  c o m
    temp = Double.doubleToLongBits(_accruedInterest);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _couponPerYear;
    temp = Double.doubleToLongBits(_factorToNextCoupon);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _yieldConvention.hashCode();
    return result;
}