List of usage examples for java.lang Double doubleToLongBits
@HotSpotIntrinsicCandidate public static long doubleToLongBits(double value)
From source file:com.opengamma.analytics.financial.equity.variance.derivative.VarianceSwap.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_currency == null) ? 0 : _currency.hashCode()); result = prime * result + _nObsExpected; result = prime * result + ((_observations == null) ? 0 : _observations.hashCode()); long temp;/*from ww w.ja va 2 s. c o m*/ temp = Double.doubleToLongBits(_timeToObsEnd); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_timeToObsStart); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_timeToSettlement); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_varNotional); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_varStrike); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }
From source file:com.scm.reader.livescanner.search.Search.java
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Search other = (Search) obj;/*www .j a v a 2 s . c o m*/ if (detail == null) { if (other.detail != null) return false; } else if (!detail.equals(other.detail)) return false; if (pending != other.pending) return false; if (id != other.id) return false; if (Double.doubleToLongBits(latitude) != Double.doubleToLongBits(other.latitude)) return false; if (Double.doubleToLongBits(longitude) != Double.doubleToLongBits(other.longitude)) return false; if (recognized != other.recognized) return false; if (searchTime == null) { if (other.searchTime != null) return false; } else if (!searchTime.equals(other.searchTime)) return false; if (selectedSearchResultId != other.selectedSearchResultId) return false; if (title == null) { if (other.title != null) return false; } else if (!title.equals(other.title)) return false; if (url == null) { if (other.url != null) return false; } else if (!url.equals(other.url)) return false; if (uuid == null) { if (other.uuid != null) return false; } else if (!uuid.equals(other.uuid)) return false; return true; }
From source file:com.opengamma.analytics.financial.instrument.future.BondFutureOptionPremiumTransactionDefinition.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _premium.hashCode(); result = prime * result + _quantity; long temp;/*from w w w .j a v a 2 s . c o m*/ temp = Double.doubleToLongBits(_tradePrice); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + _underlyingOption.hashCode(); return result; }
From source file:org.springmodules.util.ObjectsTests.java
public void testNullSafeHashCodeWithDoubleArray() { long bits = Double.doubleToLongBits(8449.65); int expected = 31 * 7 + (int) (bits ^ (bits >>> 32)); bits = Double.doubleToLongBits(9944.923); expected = 31 * expected + (int) (bits ^ (bits >>> 32)); double[] array = { 8449.65, 9944.923 }; int actual = Objects.nullSafeHashCode(array); assertEquals(expected, actual);/*from w w w. j a v a 2 s . com*/ }
From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CouponArithmeticAverageON.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/* w w w . j a va 2s . c o m*/ if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } final CouponArithmeticAverageON other = (CouponArithmeticAverageON) obj; if (!Arrays.equals(_fixingPeriodAccrualFactors, other._fixingPeriodAccrualFactors)) { return false; } if (Double.doubleToLongBits(_fixingPeriodRemainingAccrualFactor) != Double .doubleToLongBits(other._fixingPeriodRemainingAccrualFactor)) { return false; } if (!Arrays.equals(_fixingPeriodTimes, other._fixingPeriodTimes)) { return false; } if (!ObjectUtils.equals(_index, other._index)) { return false; } if (Double.doubleToLongBits(_rateAccrued) != Double.doubleToLongBits(other._rateAccrued)) { return false; } return true; }
From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborCompoundingFlatSpread.java
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp;/*from w w w . j a v a 2 s . co m*/ temp = Double.doubleToLongBits(_compoundingPeriodAmountAccumulated); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + Arrays.hashCode(_fixingSubperiodsAccrualFactors); result = prime * result + Arrays.hashCode(_fixingSubperiodsEndTimes); result = prime * result + Arrays.hashCode(_fixingSubperiodsStartTimes); result = prime * result + Arrays.hashCode(_fixingTimes); result = prime * result + ((_index == null) ? 0 : _index.hashCode()); temp = Double.doubleToLongBits(_spread); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + Arrays.hashCode(_subperiodsAccrualFactors); return result; }
From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CouponArithmeticAverageONSpread.java
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Arrays.hashCode(_fixingPeriodAccrualFactors); long temp;//w w w .jav a2 s. c o m temp = Double.doubleToLongBits(_fixingPeriodRemainingAccrualFactor); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + Arrays.hashCode(_fixingPeriodTimes); result = prime * result + _index.hashCode(); temp = Double.doubleToLongBits(_rateAccrued); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_spread); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_spreadAmount); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }
From source file:com.opengamma.analytics.financial.instrument.cash.DepositZeroDefinition.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _currency.hashCode(); result = prime * result + _endDate.hashCode(); long temp;/*w w w. j av a 2 s. c o m*/ temp = Double.doubleToLongBits(_interestAmount); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_notional); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_paymentAccrualFactor); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + _rate.hashCode(); result = prime * result + _startDate.hashCode(); return result; }
From source file:com.opengamma.analytics.financial.covariance.HistoricalVolatilityCalculator.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }// ww w . ja v a 2 s .c om if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final HistoricalVolatilityCalculator other = (HistoricalVolatilityCalculator) obj; if (_mode != other._mode) { return false; } if (Double.doubleToLongBits(_percentBadDataPoints) != Double .doubleToLongBits(other._percentBadDataPoints)) { return false; } return true; }
From source file:com.opengamma.analytics.financial.interestrate.fra.derivative.ForwardRateAgreement.java
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp;/*from ww w . j a v a 2 s .c o m*/ temp = Double.doubleToLongBits(_fixingPeriodEndTime); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_fixingPeriodStartTime); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(_fixingYearFraction); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (_forwardCurveName == null ? 0 : _forwardCurveName.hashCode()); result = prime * result + _index.hashCode(); temp = Double.doubleToLongBits(_rate); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }