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


C# IExpression.eval方法代码示例

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


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

示例1: OpLIKE

        /// <summary> Ctor.</summary>
        /// <param name="lhs">LHS.
        /// </param>
        /// <param name="pattern">Match pattern.
        /// </param>
        /// <param name="escape">Optional escape character. May be <tt>null</tt>.
        /// @throws java.lang.IllegalStateException Match pattern is invalid.
        /// </param>
        public OpLIKE(IExpression lhs, IExpression pattern, IExpression escape)
        {
            lhs_ = lhs;
            pattern_ = pattern;

            esc_ = escape;
            System.String esc = null;
            if (esc_ != null)
            {
                esc = ((System.String) esc_.eval(null)).Trim();
                if (esc.Length != 1)
                    throw new System.SystemException("ESCAPE pattern must be one character: ;" + esc + "'");
            }

            try
            {
                compiledPattern_ = compilePattern((System.String) pattern.eval(null), esc);
            }
            catch (Exception ex)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Object.toString' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
                throw new InvalidSelectorException(ex);
            }
        }
开发者ID:jamsel,项目名称:jamsel,代码行数:32,代码来源:OpLIKE.cs

示例2: eval

            public override System.Object eval(System.Collections.IDictionary identifiers, IExpression lhs, IExpression rhs)
            {
                System.Object oLhs = lhs.eval(identifiers);
                if (oLhs == null)
                    return Result.RESULT_UNKNOWN;
                else if (!(oLhs is NumericValue))
                    return Result.RESULT_FALSE;
                NumericValue nLhs = (NumericValue) oLhs;

                System.Object oRhs = rhs.eval(identifiers);
                if (oRhs == null)
                    return Result.RESULT_UNKNOWN;
                else if (!(oRhs is NumericValue))
                    return Result.RESULT_FALSE;
                NumericValue nRhs = (NumericValue) oRhs;

                return (nLhs.doubleValue() == nRhs.doubleValue())?Result.RESULT_TRUE:Result.RESULT_FALSE;
            }
开发者ID:jamsel,项目名称:jamsel,代码行数:18,代码来源:ArithCompareOpImpl.cs

示例3: eval

            public override System.Object eval(System.Collections.IDictionary identifiers, IExpression lhs, IExpression rhs)
            {
                Result bLhs = (Result) lhs.eval(identifiers);
                // Short circuit evaulation if LHS is FALSE or RESULT_UNKNOWN
                if (bLhs == Result.RESULT_FALSE)
                    return Result.RESULT_FALSE;
                else if (bLhs == Result.RESULT_UNKNOWN)
                    return Result.RESULT_UNKNOWN;

                return (Result) rhs.eval(identifiers);
            }
开发者ID:jamsel,项目名称:jamsel,代码行数:11,代码来源:ConditionalOpImpl.cs

示例4: eval

            public override System.Object eval(System.Collections.IDictionary identifiers, IExpression lhs, IExpression rhs)
            {
                System.Object oLhs = lhs.eval(identifiers);
                //UPGRADE_ISSUE: Class 'java.lang.Number' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javalangNumber"'
                if (!(oLhs is NumericValue))
                    return Result.RESULT_UNKNOWN;
                //UPGRADE_ISSUE: Class 'java.lang.Number' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javalangNumber"'
                NumericValue lhsVal = (NumericValue) oLhs;

                System.Object oRhs = rhs.eval(identifiers);
                //UPGRADE_ISSUE: Class 'java.lang.Number' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javalangNumber"'
                if (!(oRhs is NumericValue))
                    return Result.RESULT_UNKNOWN;
                //UPGRADE_ISSUE: Class 'java.lang.Number' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javalangNumber"'
                NumericValue rhsVal = (NumericValue) oRhs;

                //UPGRADE_ISSUE: Method 'java.lang.Number.doubleValue' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javalangNumber"'
                return new NumericValue(lhsVal.doubleValue() + rhsVal.doubleValue());
            }
开发者ID:jamsel,项目名称:jamsel,代码行数:19,代码来源:ArithOpImpl.cs


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