getOperator() public method

public getOperator ( ) : String
return String
Exemplo n.º 1
0
        public override bool Equals(Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if ((o == null) || !(o is BinarySentence))
            {
                return(false);
            }
            BinarySentence bs = (BinarySentence)o;

            return((bs.getOperator().Equals(getOperator())) &&
                   (bs.getFirst().Equals(first)) && (bs.getSecond()
                                                     .Equals(second)));
        }
Exemplo n.º 2
0
 public virtual Object visitBinarySentence(BinarySentence fs, Object arg)
 {
     return new BinarySentence(fs.getOperator(), (Sentence)fs.getFirst()
             .accept(this, arg), (Sentence)fs.getSecond().accept(this, arg));
 }
Exemplo n.º 3
0
	public Object visitBinarySentence(BinarySentence bs, Object arg) {
		bool? firstValue = (bool?) bs.getFirst().accept(this, null);
		bool? secondValue = (bool?) bs.getSecond().accept(this, null);
		if (!firstValue.HasValue  || !secondValue.HasValue) {
			// strictly not true for or/and
			// -FIX later
			return null;
		} else {
			String op = bs.getOperator();
			if (op.Equals("AND")) {
                return firstValue.Value && secondValue.Value;
			} else if (op.Equals("OR")) {
                return firstValue.Value || secondValue.Value;
			} else if (op.Equals("=>")) {
                return !(firstValue.Value && !secondValue.Value);
            }
            else if (op.Equals("<=>"))
            {
				return firstValue.Equals(secondValue);
			}
			return null;
		}
	}