Unit-Displaced-Black-formula pricer for capped/floored yoy inflation coupons
Наследование: YoYInflationCouponPricer
            public List<CashFlow> makeYoYCapFlooredLeg(int which, Date startDate,
                int length,
                List<double> caps,
                List<double> floors,
                double volatility,
                double gearing = 1.0,
                double spread = 0.0)
            {
                Handle<YoYOptionletVolatilitySurface> vol = new Handle<YoYOptionletVolatilitySurface>(
                   new ConstantYoYOptionletVolatility(volatility,
                                settlementDays,
                                calendar,
                                convention,
                                dc,
                                observationLag,
                                frequency,
                                iir.interpolated()));

                YoYInflationCouponPricer pricer = null;
                switch (which) {
                case 0:
                    pricer = new BlackYoYInflationCouponPricer(vol);
                    break;
                case 1:
                    pricer = new UnitDisplacedBlackYoYInflationCouponPricer(vol);
                    break;
                case 2:
                    pricer = new BachelierYoYInflationCouponPricer(vol);
                    break;
                default:
                    Assert.Fail("unknown coupon pricer request: which = "+which
                               +"should be 0=Black,1=DD,2=Bachelier");
                    break;
                }

                InitializedList<double> gearingVector = new InitializedList<double>(length, gearing);
                InitializedList<double> spreadVector = new InitializedList<double>(length, spread);

                YoYInflationIndex ii = iir as YoYInflationIndex;
                Date endDate = calendar.advance(startDate,new Period(length,TimeUnit.Years),BusinessDayConvention.Unadjusted);
                Schedule schedule = new Schedule(startDate, endDate, new Period(frequency), calendar,
                              BusinessDayConvention.Unadjusted,
                              BusinessDayConvention.Unadjusted,// ref periods & acc periods
                              DateGeneration.Rule.Forward, false);

                List<CashFlow> yoyLeg =  new yoyInflationLeg(schedule, calendar, ii, observationLag)
                .withPaymentDayCounter(dc)
                .withGearings(gearingVector)
                .withSpreads(spreadVector)
                .withCaps(caps)
                .withFloors(floors)
                .withNotionals(nominals)
                .withPaymentAdjustment(convention);

                for(int i=0; i<yoyLeg.Count; i++)
                {
                ((YoYInflationCoupon)(yoyLeg[i])).setPricer(pricer);
                }

                //setCouponPricer(iborLeg, pricer);
                return yoyLeg;
            }