public static void setCouponPricer(List <CashFlow> leg, FloatingRateCouponPricer pricer) { PricerSetter setter = new PricerSetter(pricer); foreach (CashFlow cf in leg) { cf.accept(setter); } }
public override void setPricer(FloatingRateCouponPricer pricer) { if (pricer_ != null) { pricer_.unregisterWith(update); } pricer_ = pricer; if (pricer_ != null) { pricer_.registerWith(update); } update(); underlying_.setPricer(pricer); }
public virtual void setPricer(FloatingRateCouponPricer pricer) { if (pricer_ != null) // remove from the old observable { pricer_.unregisterWith(update); } pricer_ = pricer; if (pricer_ != null) { pricer_.registerWith(update); // add to observers of new pricer } update(); // fire the change event to notify observers of this }
public PricerSetter(FloatingRateCouponPricer pricer) { pricer_ = pricer; }