public int compareKey(PointSensitivity other)
 {
     if (other is OvernightRateSensitivity)
     {
         OvernightRateSensitivity otherOn = (OvernightRateSensitivity)other;
         return(ComparisonChain.start().compare(Index.ToString(), otherOn.Index.ToString()).compare(currency, otherOn.currency).compare(observation.FixingDate, otherOn.observation.FixingDate).compare(endDate, otherOn.endDate).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is FxOptionSensitivity)
     {
         FxOptionSensitivity otherOption = (FxOptionSensitivity)other;
         return(ComparisonChain.start().compare(volatilitiesName, otherOption.volatilitiesName).compare(currencyPair.ToString(), otherOption.currencyPair.ToString()).compare(expiry, otherOption.expiry).compare(strike, otherOption.strike).compare(forward, otherOption.forward).compare(currency, otherOption.currency).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
Пример #3
0
 public int compareKey(PointSensitivity other)
 {
     if (other is IborCapletFloorletSabrSensitivity)
     {
         IborCapletFloorletSabrSensitivity otherSwpt = (IborCapletFloorletSabrSensitivity)other;
         return(ComparisonChain.start().compare(volatilitiesName, otherSwpt.volatilitiesName).compare(currency, otherSwpt.currency).compare(expiry, otherSwpt.expiry).compare(sensitivityType, otherSwpt.sensitivityType).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is BondFutureOptionSensitivity)
     {
         BondFutureOptionSensitivity otherOption = (BondFutureOptionSensitivity)other;
         return(ComparisonChain.start().compare(volatilitiesName.ToString(), otherOption.volatilitiesName.ToString()).compare(expiry, otherOption.expiry).compare(futureExpiryDate, otherOption.futureExpiryDate).compare(strikePrice, otherOption.strikePrice).compare(futurePrice, otherOption.futurePrice).compare(currency, otherOption.currency).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
Пример #5
0
 public int compareKey(PointSensitivity other)
 {
     if (other is FxIndexSensitivity)
     {
         FxIndexSensitivity otherFx = (FxIndexSensitivity)other;
         return(ComparisonChain.start().compare(Index.ToString(), otherFx.Index.ToString()).compare(currency, otherFx.currency).compare(referenceCurrency, otherFx.referenceCurrency).compare(observation.FixingDate, otherFx.observation.FixingDate).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is FxForwardSensitivity)
     {
         FxForwardSensitivity otherFx = (FxForwardSensitivity)other;
         return(ComparisonChain.start().compare(currencyPair.ToString(), otherFx.currencyPair.ToString()).compare(currency, otherFx.currency).compare(referenceCurrency, otherFx.referenceCurrency).compare(referenceDate, otherFx.referenceDate).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
Пример #7
0
 public int compareKey(PointSensitivity other)
 {
     if (other is ZeroRateSensitivity)
     {
         ZeroRateSensitivity otherZero = (ZeroRateSensitivity)other;
         return(ComparisonChain.start().compare(curveCurrency, otherZero.curveCurrency).compare(currency, otherZero.currency).compare(yearFraction, otherZero.yearFraction).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is DummyPointSensitivity)
     {
         DummyPointSensitivity otherZero = (DummyPointSensitivity)other;
         return(ComparisonChain.start().compare(curveCurrency, otherZero.curveCurrency).compare(currency, otherZero.currency).compare(date, otherZero.date).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
Пример #9
0
 public int compareKey(PointSensitivity other)
 {
     if (other is CreditCurveZeroRateSensitivity)
     {
         CreditCurveZeroRateSensitivity otherZero = (CreditCurveZeroRateSensitivity)other;
         return(ComparisonChain.start().compare(zeroRateSensitivity.YearFraction, otherZero.zeroRateSensitivity.YearFraction).compare(zeroRateSensitivity.Currency, otherZero.zeroRateSensitivity.Currency).compare(zeroRateSensitivity.CurveCurrency, otherZero.zeroRateSensitivity.CurveCurrency).compare(legalEntityId, otherZero.legalEntityId).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is SwaptionSensitivity)
     {
         SwaptionSensitivity otherSwpt = (SwaptionSensitivity)other;
         return(ComparisonChain.start().compare(volatilitiesName, otherSwpt.volatilitiesName).compare(currency, otherSwpt.currency).compare(expiry, otherSwpt.expiry).compare(tenor, otherSwpt.tenor).compare(strike, otherSwpt.strike).compare(forward, otherSwpt.forward).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
 public int compareKey(PointSensitivity other)
 {
     if (other is InflationRateSensitivity)
     {
         InflationRateSensitivity otherInflation = (InflationRateSensitivity)other;
         return(ComparisonChain.start().compare(Index.ToString(), otherInflation.Index.ToString()).compare(currency, otherInflation.currency).compare(observation.FixingMonth, otherInflation.observation.FixingMonth).result());
     }
     return(this.GetType().Name.CompareTo(other.GetType().Name));
 }
Пример #12
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this point to another.
 /// <para>
 /// The sort order is by date, then by double.
 /// This is compatible with equals.
 ///
 /// </para>
 /// </summary>
 /// <param name="other">  the other point </param>
 /// <returns> negative if this is less than, zero if equal, positive if greater than </returns>
 public int CompareTo(LocalDateDoublePoint other)
 {
     return(ComparisonChain.start().compare(date, other.date).compare(value, other.value).result());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this period to another by unadjusted start date, then unadjusted end date.
 /// </summary>
 /// <param name="other">  the other period </param>
 /// <returns> the comparison value </returns>
 public int CompareTo(SchedulePeriod other)
 {
     return(ComparisonChain.start().compare(unadjustedStartDate, other.unadjustedStartDate).compare(unadjustedEndDate, other.unadjustedEndDate).result());
 }
 /// <summary>
 /// Compares the key of two sensitivity objects, excluding the parameter sensitivity values.
 /// </summary>
 /// <param name="other">  the other sensitivity object </param>
 /// <returns> positive if greater, zero if equal, negative if less </returns>
 public int compareKey(UnitParameterSensitivity other)
 {
     return(ComparisonChain.start().compare(marketDataName, other.marketDataName).result());
 }
Пример #15
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this cash flow to another, first by date, then value.
 /// </summary>
 /// <param name="other">  the other instance </param>
 /// <returns> the comparison </returns>
 public int CompareTo(CashFlow other)
 {
     return(ComparisonChain.start().compare(paymentDate, other.paymentDate).compare(presentValue, other.presentValue).compare(forecastValue, other.forecastValue).compare(discountFactor, other.discountFactor).result());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this currency amount to another.
 /// <para>
 /// This compares currencies alphabetically, then by amount.
 ///
 /// </para>
 /// </summary>
 /// <param name="other">  the other amount </param>
 /// <returns> negative if less, zero if equal, positive if greater </returns>
 public int CompareTo(CurrencyAmount other)
 {
     return(ComparisonChain.start().compare(currency, other.currency).compare(amount, other.amount).result());
 }
 /// <summary>
 /// Compares the key of two sensitivity objects, excluding the parameter sensitivity values.
 /// </summary>
 /// <param name="other">  the other sensitivity object </param>
 /// <returns> positive if greater, zero if equal, negative if less </returns>
 public int compareKey(CrossGammaParameterSensitivity other)
 {
     return(ComparisonChain.start().compare(marketDataName, other.marketDataName).compare(order.ToString(), other.order.ToString()).compare(currency, other.currency).result());
 }
Пример #18
0
        // compare when classes differ, broken out for inlining
        private int compareSlow <T1>(MarketDataName <T1> other)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            return(ComparisonChain.start().compare(this.GetType().FullName, other.GetType().FullName).compare(Name, other.Name).result());
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this node to another by date.
 /// </summary>
 /// <param name="other">  the other curve node </param>
 /// <returns> negative if this node is earlier, positive if later and zero if equal </returns>
 public int CompareTo(LoadedCurveNode other)
 {
     return(ComparisonChain.start().compare(DateTime, other.Date).compare(Value, other.Value).compare(Label, other.Label).result());
 }
Пример #20
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this money to another.
 /// <para>
 /// This compares currencies alphabetically, then by amount.
 ///
 /// </para>
 /// </summary>
 /// <param name="other">  the other amount </param>
 /// <returns> negative if less, zero if equal, positive if greater </returns>
 public virtual int CompareTo(Money other)
 {
     return(ComparisonChain.start().compare(currency, other.currency).compare(amount, other.amount).result());
 }
Пример #21
0
        //-------------------------------------------------------------------------
        /// <summary>
        /// Compares the pair based on the first element followed by the second element.
        /// <para>
        /// The first element must be {@code Comparable}.
        ///
        /// </para>
        /// </summary>
        /// <param name="other">  the other pair </param>
        /// <returns> negative if this is less, zero if equal, positive if greater </returns>
        /// <exception cref="ClassCastException"> if the object is not comparable </exception>
        public int CompareTo(ObjIntPair <A> other)
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: return com.google.common.collect.ComparisonChain.start().compare((Comparable<?>) first, (Comparable<?>) other.first).compare(second, other.second).result();
            return(ComparisonChain.start().compare((IComparable <object>)first, (IComparable <object>)other.first).compare(second, other.second).result());
        }
Пример #22
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares the external identifiers, sorting alphabetically by scheme followed by value.
 /// </summary>
 /// <param name="other">  the other external identifier </param>
 /// <returns> negative if this is less, zero if equal, positive if greater </returns>
 public int CompareTo(StandardId other)
 {
     return(ComparisonChain.start().compare(scheme, other.scheme).compare(value, other.value).result());
 }