Ejemplo n.º 1
0
		public ThreeWayComparison(FieldValue left, IComparisonOperand right, bool swapped
			)
		{
			this._left = left;
			this._right = right;
			_swapped = swapped;
		}
Ejemplo n.º 2
0
 public override bool Equals(object other)
 {
     if (!base.Equals(other))
     {
         return(false);
     }
     Db4objects.Db4o.NativeQueries.Expr.Cmp.Operand.FieldValue casted = (Db4objects.Db4o.NativeQueries.Expr.Cmp.Operand.FieldValue
                                                                         )other;
     return(_field.Equals(casted._field));
 }
Ejemplo n.º 3
0
 public ComparisonExpression(FieldValue left, IComparisonOperand right, ComparisonOperator
     op)
 {
     if (left == null || right == null || op == null)
     {
         throw new ArgumentNullException();
     }
     _left = left;
     _right = right;
     _op = op;
 }
 public virtual void Visit(FieldValue fieldValue)
 {
     var lastFieldClass = fieldValue.Field.Type;
     var needConversion = lastFieldClass.IsPrimitive;
     fieldValue.Parent().Accept(this);
     if (_staticRoot != null)
     {
         _methodBuilder.LoadStaticField(fieldValue.Field);
         _staticRoot = null;
         return;
     }
     _methodBuilder.LoadField(fieldValue.Field);
     Box(lastFieldClass, !_inArithmetic && needConversion);
 }
		public void Visit(FieldValue operand)
		{
			operand.Parent().Accept(this);
			Type clazz = ((operand.Parent() is StaticFieldRoot) ? (Type)_value : _value.GetType
				());
			try
			{
				FieldInfo field = Reflection4.GetField(clazz, operand.FieldName());
				_value = field.GetValue(_value);
			}
			catch (Exception exc)
			{
				// arg is ignored for static
				Sharpen.Runtime.PrintStackTrace(exc);
			}
		}
Ejemplo n.º 6
0
 public virtual void Visit(FieldValue operand)
 {
     operand.Parent().Accept(this);
 }
Ejemplo n.º 7
0
			private IEnumerator FieldNames(FieldValue fieldValue)
			{
				Collection4 coll = new Collection4();
				IComparisonOperand curOp = fieldValue;
				while (curOp is FieldValue)
				{
					FieldValue curField = (FieldValue)curOp;
					coll.Prepend(curField.FieldName());
					curOp = curField.Parent();
				}
				return coll.GetEnumerator();
			}
Ejemplo n.º 8
0
		public virtual void Visit(FieldValue operand)
		{
			_clazz = operand.Field.Type;
		}
Ejemplo n.º 9
0
			private IQuery Descend(FieldValue left)
			{
				IQuery subQuery = _query;
				IEnumerator fieldNameIterator = FieldNames(left);
				while (fieldNameIterator.MoveNext())
				{
					subQuery = subQuery.Descend((string)fieldNameIterator.Current);
				}
				return subQuery;
			}