|
/* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com */
using Db4objects.Db4o.Nativequery.Expr.Cmp;
namespace Db4objects.Db4o.Nativequery.Expr.Cmp
{
public class ArithmeticExpression : IComparisonOperand
{
private ArithmeticOperator _op;
private IComparisonOperand _left;
private IComparisonOperand _right;
public ArithmeticExpression(IComparisonOperand left, IComparisonOperand right, ArithmeticOperator
op)
{
this._op = op;
this._left = left;
this._right = right;
}
public virtual IComparisonOperand Left()
{
return _left;
}
public virtual IComparisonOperand Right()
{
return _right;
}
public virtual ArithmeticOperator Op()
{
return _op;
}
public override string ToString()
{
return "(" + _left + _op + _right + ")";
}
public override bool Equals(object obj)
{
if (this == obj)
{
return true;
}
if (obj == null || obj.GetType() != GetType())
{
return false;
}
Db4objects.Db4o.Nativequery.Expr.Cmp.ArithmeticExpression casted = (Db4objects.Db4o.Nativequery.Expr.Cmp.ArithmeticExpression
)obj;
return _left.Equals(casted._left) && _right.Equals(casted._right) && _op.Equals(casted
._op);
}
public override int GetHashCode()
{
int hc = _left.GetHashCode();
hc *= 29 + _right.GetHashCode();
hc *= 29 + _op.GetHashCode();
return hc;
}
public virtual void Accept(IComparisonOperandVisitor visitor)
{
visitor.Visit(this);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.