コード例 #1
0
        /// <summary>
        /// Combines this set of sensitivities with another set.
        /// <para>
        /// This returns a new curve sensitivities with a combined map of typed sensitivities.
        /// Any sensitivities of the same type will be combined as though using
        /// <seealso cref="CurrencyParameterSensitivities#mergedWith(CurrencyParameterSensitivities)"/>.
        /// The identifier and attributes of this instance will take precedence.
        ///
        /// </para>
        /// </summary>
        /// <param name="other">  the other parameter sensitivities </param>
        /// <returns> an instance based on this one, with the other instance added </returns>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings({"rawtypes", "unchecked"}) public CurveSensitivities mergedWith(CurveSensitivities other)
        public CurveSensitivities mergedWith(CurveSensitivities other)
        {
            PortfolioItemInfo combinedInfo = info;

            if (!info.Id.Present && other.info.Id.Present)
            {
                combinedInfo = combinedInfo.withId(other.info.Id.get());
            }
            foreach (AttributeType attrType in other.info.AttributeTypes)
            {
                if (!combinedInfo.AttributeTypes.contains(attrType))
                {
                    combinedInfo = combinedInfo.withAttribute(attrType, other.info.getAttribute(attrType));
                }
            }
            return(new CurveSensitivities(combinedInfo, mergedWith(other.typedSensitivities).TypedSensitivities));
        }
コード例 #2
0
 public override PortfolioItemInfo parseSensitivityInfo(CsvRow row, PortfolioItemInfo info)
 {
     return(info.withAttribute(CCP_ATTR, row.getValue("CCP")));
 }