本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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());
}