List of usage examples for java.lang Double doubleToLongBits
@HotSpotIntrinsicCandidate public static long doubleToLongBits(double value)
From source file:com.opengamma.analytics.financial.interestrate.bond.definition.BondTransaction.java
@Override public boolean equals(Object obj) { if (this == obj) { return true; }/*from www . j a va 2 s. c o m*/ if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } BondTransaction<?> other = (BondTransaction<?>) obj; if (!ObjectUtils.equals(_bondPurchased, other._bondPurchased)) { return false; } if (!ObjectUtils.equals(_bondStandard, other._bondStandard)) { return false; } if (Double.doubleToLongBits(_notionalStandard) != Double.doubleToLongBits(other._notionalStandard)) { return false; } if (Double.doubleToLongBits(_quantity) != Double.doubleToLongBits(other._quantity)) { return false; } return true; }
From source file:com.opengamma.analytics.math.surface.InterpolatedSurfaceMultiplicativeShiftFunction.java
/** * {@inheritDoc}//from ww w .jav a 2s .c o m */ @Override public InterpolatedDoublesSurface evaluate(final InterpolatedDoublesSurface surface, final double[] xShift, final double[] yShift, final double[] percentage, final String newName) { Validate.notNull(surface, "surface"); Validate.notNull(xShift, "x shift"); Validate.notNull(yShift, "y shift"); Validate.notNull(percentage, "shifts"); final int n = xShift.length; if (n == 0) { return InterpolatedDoublesSurface.from(surface.getXDataAsPrimitive(), surface.getYDataAsPrimitive(), surface.getZDataAsPrimitive(), surface.getInterpolator(), newName); } Validate.isTrue(n == yShift.length && n == percentage.length); final Double[] x = surface.getXData(); final Double[] y = surface.getYData(); final Double[] z = surface.getZData(); final List<Double> newX = new ArrayList<>(Arrays.asList(x)); final List<Double> newY = new ArrayList<>(Arrays.asList(y)); final List<Double> newZ = new ArrayList<>(Arrays.asList(z)); final int size = surface.size(); for (int i = 0; i < n; i++) { boolean foundValue = false; for (int j = 0; j < size; j++) { if (Double.doubleToLongBits(x[j]) == Double.doubleToLongBits(xShift[i]) && Double.doubleToLongBits(y[j]) == Double.doubleToLongBits(yShift[i])) { newZ.set(j, z[j] * (1 + percentage[i])); foundValue = true; } } if (!foundValue) { newX.add(xShift[i]); newY.add(yShift[i]); newZ.add(surface.getZValue(xShift[i], yShift[i]) * (1 + percentage[i])); } } return InterpolatedDoublesSurface.from(newX, newY, newZ, surface.getInterpolator(), newName); }
From source file:org.spf4j.perf.impl.chart.InverseGrayScale.java
@Override public int hashCode() { int hash = 3; hash = 97 * hash + (int) (Double.doubleToLongBits(this.lowerBound) ^ (Double.doubleToLongBits(this.lowerBound) >>> 32)); hash = 97 * hash + (int) (Double.doubleToLongBits(this.upperBound) ^ (Double.doubleToLongBits(this.upperBound) >>> 32)); return 97 * hash + this.alpha; }
From source file:com.opengamma.analytics.financial.instrument.future.BondFutureOptionPremiumSecurityDefinition.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _expirationDate.hashCode(); result = prime * result + (_isCall ? 1231 : 1237); long temp;// w w w.j a v a 2 s . c o m temp = Double.doubleToLongBits(_strike); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + _underlyingFuture.hashCode(); return result; }
From source file:com.medlog.webservice.vo.pairs.ToneKeyValuePair.java
@Override public boolean equals(Object obj) { if (this == obj) { return true; }/*from www.j av a2s . com*/ if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ToneKeyValuePair other = (ToneKeyValuePair) obj; if (Double.doubleToLongBits(this.getValue()) != Double.doubleToLongBits(other.getValue())) { return false; } if (Double.doubleToLongBits(this.getWeightedValue()) != Double.doubleToLongBits(other.getWeightedValue())) { return false; } if (!Objects.equals(this.key, other.key)) { return false; } return true; }
From source file:org.killbill.billing.plugin.avatax.client.model.GetTaxResult.java
@Override public int hashCode() { int result;/* w w w .j a v a2 s.co m*/ long temp; result = DocCode != null ? DocCode.hashCode() : 0; result = 31 * result + (DocDate != null ? DocDate.hashCode() : 0); result = 31 * result + (Timestamp != null ? Timestamp.hashCode() : 0); temp = Double.doubleToLongBits(TotalAmount); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(TotalDiscount); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(TotalExemption); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(TotalTaxable); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(TotalTax); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(TotalTaxCalculated); result = 31 * result + (int) (temp ^ (temp >>> 32)); result = 31 * result + (TaxDate != null ? TaxDate.hashCode() : 0); result = 31 * result + (TaxLines != null ? Arrays.hashCode(TaxLines) : 0); result = 31 * result + (TaxSummary != null ? Arrays.hashCode(TaxSummary) : 0); result = 31 * result + (TaxAddresses != null ? Arrays.hashCode(TaxAddresses) : 0); result = 31 * result + (ResultCode != null ? ResultCode.hashCode() : 0); result = 31 * result + (Messages != null ? Arrays.hashCode(Messages) : 0); return result; }
From source file:com.opengamma.analytics.financial.model.option.pricing.tree.BarrierOptionFunctionProvider.java
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; }//from ww w . java 2s . c om if (!(obj instanceof BarrierOptionFunctionProvider)) { return false; } BarrierOptionFunctionProvider other = (BarrierOptionFunctionProvider) obj; if (Double.doubleToLongBits(_barrier) != Double.doubleToLongBits(other._barrier)) { return false; } if (!_checker.equals(other._checker)) { return false; } return true; }
From source file:com.opengamma.analytics.math.statistics.distribution.GeneralizedParetoDistribution.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }//w ww . j av a 2 s . co m if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final GeneralizedParetoDistribution other = (GeneralizedParetoDistribution) obj; if (Double.doubleToLongBits(_ksi) != Double.doubleToLongBits(other._ksi)) { return false; } if (Double.doubleToLongBits(_mu) != Double.doubleToLongBits(other._mu)) { return false; } return Double.doubleToLongBits(_sigma) == Double.doubleToLongBits(other._sigma); }
From source file:com.opengamma.analytics.financial.forex.definition.ForexOptionSingleBarrierDefinition.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }// w w w . ja v a2 s . c o m if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ForexOptionSingleBarrierDefinition other = (ForexOptionSingleBarrierDefinition) obj; if (_barrier != other._barrier) { return false; } if (Double.doubleToLongBits(_rebate) != Double.doubleToLongBits(other._rebate)) { return false; } if (!ObjectUtils.equals(_underlyingOption, other._underlyingOption)) { return false; } return true; }
From source file:com.opengamma.analytics.financial.equity.future.definition.EquityFutureDefinition.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }//from w w w . j a v a 2s . c om if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final EquityFutureDefinition other = (EquityFutureDefinition) obj; if (Double.doubleToLongBits(_strikePrice) != Double.doubleToLongBits(other._strikePrice)) { return false; } if (!ObjectUtils.equals(_expiryDate, other._expiryDate)) { return false; } if (!ObjectUtils.equals(_settlementDate, other._settlementDate)) { return false; } if (!ObjectUtils.equals(_currency, other._currency)) { return false; } if (Double.doubleToLongBits(_unitAmount) != Double.doubleToLongBits(other._unitAmount)) { return false; } return true; }