Пример #1
0
        /// <summary>
        /// Evaluates the node, using the variables provided in the <paramref name="Variables"/> collection.
        /// </summary>
        /// <param name="Variables">Variables collection.</param>
        /// <returns>Result.</returns>
        public override IElement Evaluate(Variables Variables)
        {
            IElement E = this.op.Evaluate(Variables);

            if (E is ISet)
            {
                return(E);
            }

            IVector V = E as IVector;

            if (V != null)
            {
                return(SetDefinition.Encapsulate(V.VectorElements, this));
            }

            return(SetDefinition.Encapsulate(new IElement[] { E }, this));
        }
Пример #2
0
        private IElement ConvertToSet(IElement E)
        {
            if (this.nullCheck && E.AssociatedObjectValue is null)
            {
                return(E);
            }

            if (E is ISet)
            {
                return(E);
            }

            if (E is IVector V)
            {
                return(SetDefinition.Encapsulate(V.VectorElements, this));
            }

            if (this.nullCheck && E.AssociatedObjectValue is null)
            {
                return(E);
            }

            return(SetDefinition.Encapsulate(new IElement[] { E }, this));
        }
Пример #3
0
 /// <summary>
 /// Encapsulates the calculated elements.
 /// </summary>
 /// <param name="Elements">Elements</param>
 /// <returns>Encapsulated elements.</returns>
 protected override IElement Encapsulate(LinkedList <IElement> Elements)
 {
     return(SetDefinition.Encapsulate(Elements, this));
 }