Example #1
0
        public virtual bool GetChildValueAsBool(XmlNode node, string name, bool mandatory = false)
        {
            string s = GetChildValue(node, name, mandatory);

            return(s == "" ? true : Parsers.ParseBool(s));
        }
Example #2
0
        public virtual int GetChildValueAsInt(XmlNode node, string name, bool mandatory = false)
        {
            string s = GetChildValue(node, name, mandatory);

            return(s == "" ? 0 : Parsers.ParseInteger(s));
        }
Example #3
0
        public virtual double GetChildValueAsDouble(XmlNode node, string name, bool mandatory = false)
        {
            string s = GetChildValue(node, name, mandatory);

            return(s == "" ? 0.0 : Parsers.ParseDouble(s));
        }
Example #4
0
        public List <double> GetChildrenValuesAsDoublesCompact(XmlNode node, string name, bool mandatory)
        {
            string s = GetChildValue(node, name, mandatory);

            return(Parsers.ParseListOfValues <double>(s, Parsers.ParseDouble));
        }
Example #5
0
        public List <Period> GetChildrenValuesAsPeriods(XmlNode node, string name, bool mandatory)
        {
            string s = GetChildValue(node, name, mandatory);

            return(Parsers.ParseListOfValues <Period>(s, Parsers.ParsePeriod));
        }
Example #6
0
        public virtual void Build()
        {
            // First check that we have an overnight index.
            _index = (OvernightIndex)Parsers.ParseIborIndex(_strIndex);
            Utils.QL_REQUIRE(_index != null, () => "The index string, " + _strIndex + ", does not represent an overnight index.");

            _spotLag                = Parsers.ParseInteger(_strSpotLag);
            _fixedDayCounter        = Parsers.ParseDayCounter(_strFixedDayCounter);
            _paymentLag             = _strPaymentLag == string.Empty ? 0 : Parsers.ParseInteger(_strPaymentLag);
            _eom                    = _strEom == string.Empty ? false : Parsers.ParseBool(_strEom);
            _fixedFrequency         = _strFixedFrequency == string.Empty ? Frequency.Annual : Parsers.ParseFrequency(_strFixedFrequency);
            _fixedConvention        = _strFixedConvention == string.Empty ? BusinessDayConvention.Following : Parsers.ParseBusinessDayConvention(_strFixedConvention);
            _fixedPaymentConvention = _strFixedPaymentConvention == string.Empty ? BusinessDayConvention.Following : Parsers.ParseBusinessDayConvention(_strFixedPaymentConvention);
            //_rule = _strRule == string.Empty ? DateGeneration.Rule.Backward : Parsers.ParseDateGenerationRule(_strRule);
        }