Operand corresponding to Boolean Type
Inheritance: Operand, ILogicalOperations
示例#1
0
        public IOperand OR(IOperand rhs)
        {
            if (!(rhs is BoolOperand))
            {
                throw new RPN_Exception("Argument invalid in BoolOperand.|| : rhs");
            }
            BoolOperand oprResult = new BoolOperand("Result");

            oprResult.Value = ((bool)this.Value || (bool)((Operand)rhs).Value) ? true : false;
            return(oprResult);
        }
示例#2
0
        public IOperand GreaterThanOrEqualTo(IOperand rhs)
        {
            if (!(rhs is LongOperand))
            {
                throw new RPN_Exception("Argument invalid in LongOperand.>= : rhs");
            }
            BoolOperand oprResult = new BoolOperand("Result");

            oprResult.Value = ((long)this.Value >= (long)((Operand)rhs).Value) ? true : false;
            return(oprResult);
        }
示例#3
0
        public IOperand LessThan(IOperand rhs)
        {
            if (!(rhs is LongOperand))
            {
                throw new RPN_Exception("Argument invalid in LongOperand.< : rhs");
            }
            BoolOperand oprResult = new BoolOperand("Result");

            oprResult.Value = ((long)this.Value < (long)((Operand)rhs).Value) ? true : false;
            return(oprResult);
        }
示例#4
0
        /// IComparisonOperators methods.  Return values are always BooleanOperands type
        public IOperand EqualTo(IOperand rhs)
        {
            if (!(rhs is LongOperand))
            {
                throw new RPN_Exception("Argument invalid in LongOperand.== : rhs");
            }
            BoolOperand oprResult = new BoolOperand("Result");

            oprResult.Value = (long)this.Value == (long)((Operand)rhs).Value;
            return(oprResult);
        }
示例#5
0
文件: RPNParser.cs 项目: 2ty/race3d
 public IOperand NotEqualTo( IOperand rhs)
 {
     if( !(rhs is LongOperand) )
         throw new RPN_Exception("Argument invalid in LongOperand.!= : rhs" );
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = ((long)this.Value != (long)((Operand)rhs).Value) ? true : false;
     return oprResult;
 }
示例#6
0
文件: RPNParser.cs 项目: 2ty/race3d
 public IOperand OR( IOperand rhs)
 {
     if( !(rhs is BoolOperand) )
         throw new RPN_Exception("Argument invalid in BoolOperand.|| : rhs" );
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = ((bool)this.Value || (bool)((Operand)rhs).Value) ? true : false;
     return oprResult;
 }