@Override
 public int compareKey(PointSensitivity other) {
   if (other instanceof 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 getClass().getSimpleName().compareTo(other.getClass().getSimpleName());
 }
예제 #2
0
 @Override
 public int compareKey(PointSensitivity other) {
   if (other instanceof SwaptionSensitivity) {
     SwaptionSensitivity otherSwpt = (SwaptionSensitivity) other;
     return ComparisonChain.start()
         .compare(currency, otherSwpt.currency)
         .compare(expiry, otherSwpt.expiry)
         .compare(tenor, otherSwpt.tenor)
         .compare(strike, otherSwpt.strike)
         .compare(forward, otherSwpt.forward)
         .compare(convention.toString(), otherSwpt.convention.toString())
         .result();
   }
   return getClass().getSimpleName().compareTo(other.getClass().getSimpleName());
 }