gpt4 book ai didi

com.opengamma.strata.pricer.ZeroRatePeriodicDiscountFactors.getCurrency()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:14:28 30 4
gpt4 key购买 nike

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

ZeroRatePeriodicDiscountFactors.getCurrency介绍

[英]Gets the currency that the discount factors are for.
[中]获取折扣系数所针对的货币。

代码示例

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

@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
 switch (propertyName.hashCode()) {
  case 575402001:  // currency
   return ((ZeroRatePeriodicDiscountFactors) bean).getCurrency();
  case 113107279:  // valuationDate
   return ((ZeroRatePeriodicDiscountFactors) bean).getValuationDate();
  case 95027439:  // curve
   return ((ZeroRatePeriodicDiscountFactors) bean).getCurve();
 }
 return super.propertyGet(bean, propertyName, quiet);
}

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

public void test_of() {
 ZeroRatePeriodicDiscountFactors test = ZeroRatePeriodicDiscountFactors.of(GBP, DATE_VAL, CURVE);
 assertEquals(test.getCurrency(), GBP);
 assertEquals(test.getValuationDate(), DATE_VAL);
 assertEquals(test.getCurve(), CURVE);
 assertEquals(test.getParameterCount(), CURVE.getParameterCount());
 assertEquals(test.getParameter(0), CURVE.getParameter(0));
 assertEquals(test.getParameterMetadata(0), CURVE.getParameterMetadata(0));
 assertEquals(test.withParameter(0, 1d).getCurve(), CURVE.withParameter(0, 1d));
 assertEquals(test.withPerturbation((i, v, m) -> v + 1d).getCurve(), CURVE.withPerturbation((i, v, m) -> v + 1d));
 assertEquals(test.findData(CURVE.getName()), Optional.of(CURVE));
 assertEquals(test.findData(CurveName.of("Rubbish")), Optional.empty());
}

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