gpt4 book ai didi

com.opengamma.strata.market.param.YearMonthDateParameterMetadata.getDate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 03:21:31 34 4
gpt4 key购买 nike

本文整理了Java中com.opengamma.strata.market.param.YearMonthDateParameterMetadata.getDate()方法的一些代码示例,展示了YearMonthDateParameterMetadata.getDate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDateParameterMetadata.getDate()方法的具体详情如下:
包路径:com.opengamma.strata.market.param.YearMonthDateParameterMetadata
类名称:YearMonthDateParameterMetadata
方法名:getDate

YearMonthDateParameterMetadata.getDate介绍

[英]Gets the date associated with the parameter.

This is the date that is most closely associated with the parameter. The actual parameter is typically a year fraction based on a day count.
[中]获取与参数关联的日期。
这是与参数关联最密切的日期。实际参数通常是基于天数的年分数。

代码示例

代码示例来源:origin: OpenGamma/Strata

@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
 switch (propertyName.hashCode()) {
  case 3076014:  // date
   return ((YearMonthDateParameterMetadata) bean).getDate();
  case -496678845:  // yearMonth
   return ((YearMonthDateParameterMetadata) bean).getYearMonth();
  case 102727412:  // label
   return ((YearMonthDateParameterMetadata) bean).getLabel();
 }
 return super.propertyGet(bean, propertyName, quiet);
}

代码示例来源:origin: OpenGamma/Strata

public void test_of_label() {
 YearMonthDateParameterMetadata test = YearMonthDateParameterMetadata.of(DATE, JAN2015, "Jan 2015");
 assertEquals(test.getDate(), DATE);
 assertEquals(test.getYearMonth(), JAN2015);
 assertEquals(test.getLabel(), "Jan 2015");
 assertEquals(test.getIdentifier(), JAN2015);
}

代码示例来源:origin: OpenGamma/Strata

public void test_of_noLabel() {
 YearMonthDateParameterMetadata test = YearMonthDateParameterMetadata.of(DATE, JAN2015);
 assertEquals(test.getDate(), DATE);
 assertEquals(test.getYearMonth(), JAN2015);
 assertEquals(test.getLabel(), "Jan15");
 assertEquals(test.getIdentifier(), JAN2015);
}

代码示例来源:origin: OpenGamma/Strata

public void test_metadata_end() {
 IborFutureCurveNode node = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL);
 LocalDate date = LocalDate.of(2015, 10, 20);
 LocalDate referenceDate = TEMPLATE.calculateReferenceDateFromTradeDate(date, REF_DATA);
 LocalDate maturityDate = TEMPLATE.getIndex().calculateMaturityFromEffective(referenceDate, REF_DATA);
 ParameterMetadata metadata = node.metadata(date, REF_DATA);
 assertEquals(metadata.getLabel(), LABEL);
 assertTrue(metadata instanceof YearMonthDateParameterMetadata);
 assertEquals(((YearMonthDateParameterMetadata) metadata).getDate(), maturityDate);
 assertEquals(((YearMonthDateParameterMetadata) metadata).getYearMonth(), YearMonth.from(referenceDate));
}

代码示例来源:origin: OpenGamma/Strata

public void test_builder_defaultLabel() {
 BeanBuilder<? extends YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();
 builder.set(YearMonthDateParameterMetadata.meta().date(), DATE);
 builder.set(YearMonthDateParameterMetadata.meta().yearMonth(), JAN2015);
 YearMonthDateParameterMetadata test = builder.build();
 assertEquals(test.getDate(), DATE);
 assertEquals(test.getYearMonth(), JAN2015);
 assertEquals(test.getLabel(), "Jan15");
 assertEquals(test.getIdentifier(), JAN2015);
}

代码示例来源:origin: OpenGamma/Strata

public void test_builder_specifyLabel() {
 BeanBuilder<? extends YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();
 builder.set(YearMonthDateParameterMetadata.meta().date(), DATE);
 builder.set(YearMonthDateParameterMetadata.meta().yearMonth(), JAN2015);
 builder.set(YearMonthDateParameterMetadata.meta().label(), "Jan 2015");
 YearMonthDateParameterMetadata test = builder.build();
 assertEquals(test.getDate(), DATE);
 assertEquals(test.getYearMonth(), JAN2015);
 assertEquals(test.getLabel(), "Jan 2015");
 assertEquals(test.getIdentifier(), JAN2015);
}

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com