Beispiel #1
0
        /// <summary>
        /// Compares the element to another.
        /// </summary>
        /// <param name="obj">Other element to compare against.</param>
        /// <returns>If elements are equal.</returns>
        public override bool Equals(object obj)
        {
            DateTimeVector DateTimeVector = obj as DateTimeVector;

            if (DateTimeVector == null)
            {
                return(false);
            }

            int i;

            if (DateTimeVector.dimension != this.dimension)
            {
                return(false);
            }

            DateTime[] Values  = this.Values;
            DateTime[] Values2 = DateTimeVector.Values;
            for (i = 0; i < this.dimension; i++)
            {
                if (Values[i] != Values2[i])
                {
                    return(false);
                }
            }

            return(true);
        }
        /// <summary>
        /// Checks if the set contains an element.
        /// </summary>
        /// <param name="Element">Element.</param>
        /// <returns>If the element is contained in the set.</returns>
        public override bool Contains(IElement Element)
        {
            DateTimeVector v = Element as DateTimeVector;

            if (v is null)
            {
                return(false);
            }

            return(v.Dimension == this.dimension);
        }