public override bool equals(ConsistencyExpression ce)
 {
     if (ce is LabelInstanceConsistencyExpression)
     {
         LabelInstanceConsistencyExpression lice = (ce as LabelInstanceConsistencyExpression);
         if (this.isMultipleValue())
             return this.arrayEquals(lice); // Might use getSetExpression, but this one is more efficient.
         else
             return lice.getValue().Equals(this.getValue());
     }
     else if (ce is StringConsistencyExpression)
     {
         StringConsistencyExpression sce = (ce as StringConsistencyExpression);
         return sce.getValue().Equals(this.getValue());
     }
     else if (ce is PropertyConsistencyExpression)
     {
         PropertyConsistencyExpression pce = (ce as PropertyConsistencyExpression);
         return pce.getValue().Equals(this.getValue());
     }
     else if (ce is SetConsistencyExpression)
     {
         return this.getSetExpression().equals(ce);
     }
     else
     {
         return base.equals(ce);
     }
 }
 public override bool equals(ConsistencyExpression ce)
 {
     if (ce is PropertyConsistencyExpression)
     {
         PropertyConsistencyExpression pce = (ce as PropertyConsistencyExpression);
         return pce.property.Value == this.property.Value
             && pce.property.Type == this.property.Type;
     }
     else
         return ce.equals(this);
 }
Пример #3
0
 public override bool equals(ConsistencyExpression ce)
 {
     if (ce is BooleanConsistencyExpression)
     {
         return value == (ce as BooleanConsistencyExpression).value;
     }
     else if (ce is PropertyConsistencyExpression)
     {
         PropertyConsistencyExpression pce = (ce as PropertyConsistencyExpression);
         return pce.getValue().Equals(value);
     }
     else
     {
         return base.equals(ce);
     }
 }
Пример #4
0
        public override bool equals(ConsistencyExpression ce)
        {
            if (ce is SetConsistencyExpression)
            {
                SetConsistencyExpression sce = (ce as SetConsistencyExpression);
                if (members.Count != sce.members.Count)
                    return false;
                for (int i=0 ; i<members.Count ; i++){
                    bool found = false;
                    for (int j = i; j < sce.members.Count; j++)
                    {
                        try
                        {
                            if (members[i].equals(sce.members[j]))
                            {
                                ConsistencyExpression tmp = sce.members[i];
                                sce.members[i] = sce.members[j];
                                sce.members[j] = tmp;
                                found = true;
                                break;
                            }
                        }
                        catch
                        {
                        }

                    }
                    if (!found)
                        return false;
                }
                return true;
            }
            else if (ce is LabelInstanceConsistencyExpression)
            {
                LabelInstanceConsistencyExpression lice = ce as LabelInstanceConsistencyExpression;
                return lice.getSetExpression().equals(this);
            }
            else
            {
                return base.equals(ce);
            }
        }
Пример #5
0
 public override bool greaterThan(ConsistencyExpression ce)
 {
     if (ce is DoubleConsistencyExpression)
     {
         return this.value > (ce as DoubleConsistencyExpression).value;
     }
     else if (ce is PropertyConsistencyExpression)
     {
         PropertyConsistencyExpression pce = (ce as PropertyConsistencyExpression);
         if (pce.getValue() is double)
         {
             return this.value > (pce.getValue() as double?);
         }
         else
             return false;
     }
     else
     {
         return base.greaterThan(ce);
     }
 }
Пример #6
0
 public override bool equals(ConsistencyExpression ce)
 {
     if (ce is StringConsistencyExpression)
     {
         StringConsistencyExpression sce = (ce as StringConsistencyExpression);
         return sce.getValue().Equals(this.getValue());
     }
     else if (ce is LabelInstanceConsistencyExpression)
     {
         LabelInstanceConsistencyExpression lice = (ce as LabelInstanceConsistencyExpression);
         return lice.getValue().Equals(this.getValue());
     }
     else if (ce is PropertyConsistencyExpression)
     {
         PropertyConsistencyExpression pce = (ce as PropertyConsistencyExpression);
         return this.getValue().Equals(pce.getValue());
     }
     else
     {
         return base.equals(ce);
     }
 }
 public override bool hasIN(ConsistencyExpression ce)
 {
     if (!isMultipleValue())
     {
         return base.hasIN(ce);
     }
     object[] arr = (object[])this.getValue();
     foreach (object o in arr)
     {
         if (ce is StringConsistencyExpression)
         {
             if (o.Equals((ce as StringConsistencyExpression).getValue()))
             {
                 return true;
             }
         }
         else if (ce is DoubleConsistencyExpression)
         {
             if (o.Equals((ce as DoubleConsistencyExpression).getValue()))
             {
                 return true;
             }
         }
         else
         {
             return false;
         }
     }
     return false;
 }
Пример #8
0
 public virtual bool hasIN(ConsistencyExpression ce)
 {
     throw new Exception("Operand makes no scence.");
 }
Пример #9
0
 public bool greaterEqual(ConsistencyExpression ce)
 {
     return greaterThan(ce) || equals(ce);
 }
Пример #10
0
 public override bool hasIN(ConsistencyExpression ce)
 {
     foreach (ConsistencyExpression ceMember in members)
         if (ceMember.equals(ce))
             return true;
     return false;
 }