当前位置: 首页>>代码示例>>C#>>正文


C# VTDNav.parseDouble方法代码示例

本文整理汇总了C#中com.ximpleware.VTDNav.parseDouble方法的典型用法代码示例。如果您正苦于以下问题:C# VTDNav.parseDouble方法的具体用法?C# VTDNav.parseDouble怎么用?C# VTDNav.parseDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ximpleware.VTDNav的用法示例。


在下文中一共展示了VTDNav.parseDouble方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: sum

 private double sum(VTDNav vn)
 {
     double d = 0;
     /*if (argCount() != 1 || argumentList.e.NodeSet == false)
         throw new System.ArgumentException("sum()'s argument count is invalid");*/
     vn.push2();
     try
     {
         a = 0;
         int i1;
         while ((a = argumentList.e.evalNodeSet(vn)) != -1)
         {
             int t = vn.getTokenType(a);
             if (t == VTDNav.TOKEN_STARTING_TAG)
             {
                 i1 = vn.getText();
                 if (i1 != -1)
                     d = d + vn.parseDouble(i1);
                 if (System.Double.IsNaN(d))
                     break;
             }
             else if (t == VTDNav.TOKEN_ATTR_NAME || t == VTDNav.TOKEN_ATTR_NS)
             {
                 d = d + vn.parseDouble(a + 1);
                 if (System.Double.IsNaN(d))
                     break;
             }
             else if (t == VTDNav.TOKEN_CHARACTER_DATA
                 || t == VTDNav.TOKEN_CDATA_VAL
                 || t == VTDNav.TOKEN_COMMENT)
             {
                 d = d + vn.parseDouble(a);
                 if (System.Double.IsNaN(d))
                     break;
             }
             else if (t == VTDNav.TOKEN_PI_NAME)
             {
                 if (a + 1 < vn.vtdSize && vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                 {
                     d += vn.parseDouble(a + 1);
                 }
                 else
                 {
                     d = Double.NaN;
                     break;
                 }
             }
             //    fib1.append(i);
         }
         argumentList.e.reset(vn);
         vn.pop2();
         return d;
     }
     catch (System.Exception e)
     {
         argumentList.e.reset(vn);
         vn.pop2();
         return System.Double.NaN;
     }
 }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:60,代码来源:FuncExpr.cs

示例2: evalNumber

        public override double evalNumber(VTDNav vn)
        {
            double d = Double.NaN;
            int a = -1;
            vn.push2();
            int size = vn.contextStack2.size;
            try
            {
                a = evalNodeSet(vn);
                if (a != -1)
                {
                    int t = vn.getTokenType(a);
                    if (t == VTDNav.TOKEN_ATTR_NAME)
                    {
                        d = vn.parseDouble(a + 1);
                    }
                    else if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                    {
                        String s = vn.getXPathStringVal();
                        d = Double.Parse(s);
                    }
                    else if (t == VTDNav.TOKEN_PI_NAME)
                    {
                        if (a + 1 < vn.vtdSize || vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                            d = vn.parseDouble(a + 1);
                    }
                    else
                        d = vn.parseDouble(a);
                }
            }
            catch (Exception e)
            {

            }
            vn.contextStack2.size = size;
            reset(vn);
            vn.pop2();
            //return s;
            return d;
        }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:40,代码来源:LocationPathExpr.cs

示例3: evalNumber

		/// <summary>
		/// 
		/// </summary>
		/// <param name="vn"></param>
		/// <returns></returns>
		public override double evalNumber(VTDNav vn)
		{
            double d = Double.NaN;
            int a = 0x7fffffff, k = -1;
            vn.push2();
            int size = vn.contextStack2.size;
            try
            {
                while ((k = evalNodeSet(vn)) != -1)
                {
                    //a = evalNodeSet(vn);
                    if (k < a)
                        a = k;
                }
                if (a == 0x7fffffff)
                    a = -1;
                if (a != -1)
                {
                    int t = vn.getTokenType(a);
                    if (t == VTDNav.TOKEN_ATTR_NAME)
                    {
                        d = vn.parseDouble(a + 1);
                    }
                    else if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                    {
                        d = vn.XPathStringVal2Double(a);//Double.parseDouble(s);
                    }
                    else if (t == VTDNav.TOKEN_PI_NAME)
                    {
                        if (a + 1 < vn.vtdSize || vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                            //s = vn.toString(a+1); 	
                            d = vn.parseDouble(a + 1);
                        else
                            d = Double.NaN;
                    }
                    else
                        d = vn.parseDouble(a);
                }
            }
            catch (Exception e)
            {

            }
            vn.contextStack2.size = size;
            reset(vn);
            vn.pop2();
            //return s;
            return d;
		}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:54,代码来源:PathExpr.cs

示例4: compareVNumber2

 private bool compareVNumber2(int k, VTDNav vn, double d, int op)
 {
     double d1;
     int t = vn.getTokenType(k);
     if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
     {
         d1 = vn.XPathStringVal2Double(k);
     }
     else
     {
         k = getStringVal(vn, k);
         d1 = vn.parseDouble(k);
     }
     switch (op)
     {
         case EQ:
             return d1 == d;
         case NE:
             return d1 != d;
         case GE:
             return d1 >= d;
         case LE:
             return d1 <= d;
         case GT:
             return d1 > d;
         default:
             return d1 < d;
     }
 }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:29,代码来源:BinaryExpr.cs

示例5: evalNumber

		public override double evalNumber(VTDNav vn)
		{
			//double d;
			int a = - 1;
			vn.push2();
			int size = vn.contextStack2.size;
			try
			{
				a = evalNodeSet(vn);
				if (a != - 1)
				{
					if (vn.getTokenType(a) == VTDNav.TOKEN_ATTR_NAME)
					{
						a++;
					}
					else if (vn.getTokenType(a) == VTDNav.TOKEN_STARTING_TAG)
					{
						a = vn.getText();
					}
				}
			}
			catch (System.Exception e)
			{
				
			}
			vn.contextStack2.size = size;
			reset(vn);
			vn.pop2();
			try
			{
				if (a != - 1)
					return vn.parseDouble(a);
			}
			catch (NavException e)
			{
			}
			return System.Double.NaN;
		}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:38,代码来源:FilterExpr.cs

示例6: compareVNumber2

 private bool compareVNumber2(int k, VTDNav vn, double d, int op)
 {
     double d1 = vn.parseDouble(k);
     switch (op)
     {
         case EQ:
             return d1 == d;
         case NE:
             return d1 != d;
         case GE:
             return d1 >= d;
         case LE:
             return d1 <= d;
         case GT:
             return d1 > d;
         default:
             return d1 < d;
     }
 }
开发者ID:DuLerWeil,项目名称:vtd-xml,代码行数:19,代码来源:BinaryExpr.cs

示例7: compareVNumber1

 private bool compareVNumber1(int k, VTDNav vn, double d, int op)
 {
     double d1 = vn.parseDouble(k);
     switch (op)
     {
         case EQ:
             return d == d1;
         case NE:
             return d != d1;
         case GE:
             return d >= d1;
         case LE:
             return d <= d1;
         case GT:
             return d > d1;
         default:
             return d < d1;
     }
 }
开发者ID:DuLerWeil,项目名称:vtd-xml,代码行数:19,代码来源:BinaryExpr.cs


注:本文中的com.ximpleware.VTDNav.parseDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。