protected Operator(String op, int precedence, OperatorSubType subType) { if (subType != OperatorSubType.None && subType != OperatorSubType.Any && subType != OperatorSubType.All) { throw new ArgumentException("Invalid sub type.", "subType"); } this.op = op; this.precedence = precedence; this.subType = subType; }
/// <summary> /// Returns the ANY or ALL form of this operator. /// </summary> /// <param name="type"></param> /// <returns></returns> public Operator GetSubQueryForm(OperatorSubType type) { Operator resultOp = null; if (type == OperatorSubType.Any) { AnyMap.TryGetValue(op, out resultOp); } else if (type == OperatorSubType.All) { AllMap.TryGetValue(op, out resultOp); } else if (type == OperatorSubType.None) { resultOp = Get(op); } if (resultOp == null) { throw new ApplicationException("Couldn't change the form of operator '" + op + "'."); } return(resultOp); }
/// <summary> /// Given a parameter of either NONE, ANY, ALL or SINGLE, this returns true /// if this operator is of the given type. /// </summary> /// <param name="type"></param> /// <returns></returns> public bool IsSubQueryForm(OperatorSubType type) { return type == subType; }
/// <summary> /// Returns the ANY or ALL form of this operator. /// </summary> /// <param name="type"></param> /// <returns></returns> public Operator GetSubQueryForm(OperatorSubType type) { Operator resultOp = null; if (type == OperatorSubType.Any) { AnyMap.TryGetValue(op, out resultOp); } else if (type == OperatorSubType.All) { AllMap.TryGetValue(op, out resultOp); } else if (type == OperatorSubType.None) { resultOp = Get(op); } if (resultOp == null) throw new ApplicationException("Couldn't change the form of operator '" + op + "'."); return resultOp; }
protected Operator(String op, int precedence, OperatorSubType subType) { if (subType != OperatorSubType.None && subType != OperatorSubType.Any && subType != OperatorSubType.All) throw new ArgumentException("Invalid sub type.", "subType"); this.op = op; this.precedence = precedence; this.subType = subType; }
/// <summary> /// Given a parameter of either NONE, ANY, ALL or SINGLE, this returns true /// if this operator is of the given type. /// </summary> /// <param name="type"></param> /// <returns></returns> public bool IsSubQueryForm(OperatorSubType type) { return(type == subType); }