示例#1
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ImmutableIborFutureConvention beanToCopy)
 {
     this.index_Renamed                 = beanToCopy.Index;
     this.name_Renamed                  = beanToCopy.Name;
     this.dateSequence_Renamed          = beanToCopy.DateSequence;
     this.businessDayAdjustment_Renamed = beanToCopy.BusinessDayAdjustment;
 }
示例#2
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 100346066:         // index
                    this.index_Renamed = (IborIndex)newValue;
                    break;

                case 3373707:         // name
                    this.name_Renamed = (string)newValue;
                    break;

                case -258065009:         // dateSequence
                    this.dateSequence_Renamed = (DateSequence)newValue;
                    break;

                case -1065319863:         // businessDayAdjustment
                    this.businessDayAdjustment_Renamed = (BusinessDayAdjustment)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
	  public virtual void test_QUARTERLY_IMM()
	  {
		DateSequence test = DateSequences.QUARTERLY_IMM;
		assertEquals(test.Name, "Quarterly-IMM");
		assertEquals(test.ToString(), "Quarterly-IMM");
		assertEquals(test.dateMatching(YearMonth.of(2013, 3)), LocalDate.of(2013, 3, 20));
	  }
示例#4
0
 private ImmutableIborFutureConvention(IborIndex index, string name, DateSequence dateSequence, BusinessDayAdjustment businessDayAdjustment)
 {
     JodaBeanUtils.notNull(index, "index");
     JodaBeanUtils.notNull(name, "name");
     JodaBeanUtils.notNull(dateSequence, "dateSequence");
     JodaBeanUtils.notNull(businessDayAdjustment, "businessDayAdjustment");
     this.index                 = index;
     this.name                  = name;
     this.dateSequence          = dateSequence;
     this.businessDayAdjustment = businessDayAdjustment;
 }
示例#5
0
        public void TestSequence()
        {
            DateTime     dateStart = new DateTime(2010, 1, 1);
            TimeSpan     interval  = TimeSpan.FromHours(1);
            DateSequence sequence  = new DateSequence(dateStart, interval);
            DateTime     prev      = dateStart;

            for (int i = 0; i < 1000; i++)
            {
                DateTime nextDate = sequence.Next();
                Assert.True(nextDate > prev);
            }
        }
示例#6
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates a convention based on the specified index and the sequence of dates.
 /// <para>
 /// The standard market convention is based on the index.
 /// The business day adjustment is set to be 'Following' using the effective date calendar from the index.
 /// The convention name will default to the name of the index suffixed by the
 /// name of the date sequence.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index, the calendar for the adjustment is extracted from the index </param>
 /// <param name="dateSequence">  the sequence of dates </param>
 /// <returns> the convention </returns>
 public static ImmutableIborFutureConvention of(IborIndex index, DateSequence dateSequence)
 {
     return(ImmutableIborFutureConvention.builder().index(index).dateSequence(dateSequence).build());
 }
示例#7
0
 /// <summary>
 /// Sets the sequence of dates that the future is based on.
 /// <para>
 /// This is used to calculate the reference date of the future that is the start
 /// date of the underlying synthetic deposit.
 /// </para>
 /// </summary>
 /// <param name="dateSequence">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder dateSequence(DateSequence dateSequence)
 {
     JodaBeanUtils.notNull(dateSequence, "dateSequence");
     this.dateSequence_Renamed = dateSequence;
     return(this);
 }
	  public virtual void test_QUARTERLY_10TH_of()
	  {
		DateSequence test = DateSequence.of("Quarterly-10th");
		assertEquals(test, DateSequences.QUARTERLY_10TH);
	  }
	  public virtual void test_QUARTERLY_IMM_of()
	  {
		DateSequence test = DateSequence.of("Quarterly-IMM");
		assertEquals(test, DateSequences.QUARTERLY_IMM);
	  }
	  //-------------------------------------------------------------------------
	  public virtual void test_extendedEnum()
	  {
		assertEquals(DateSequence.extendedEnum().lookupAll().get("Quarterly-IMM"), DateSequences.QUARTERLY_IMM);
	  }