2using System.Collections.Generic;
13 private readonly
ISet set1;
14 private readonly
ISet set2;
42 public override bool Equals(
object obj)
47 return (this.set1.Equals(S.set1) &&
this.set2.Equals(S.set2));
58 return this.set1.GetHashCode() ^ this.set2.GetHashCode();
68 if (!(this.elements is
null))
69 return this.elements.Keys;
71 ICollection<IElement> E1 = this.set1.ChildElements;
75 ICollection<IElement> E2 = this.set2.ChildElements;
79 Dictionary<IElement, bool> Elements =
new Dictionary<IElement, bool>();
87 this.elements = Elements;
92 private Dictionary<IElement, bool> elements =
null;
97 return this.set1.ToString() +
"∪" + this.set2.ToString();
108 if (Elements is
null)
111 object[] Elements2 =
new object[Elements.Count];
129 if (ChildElements is
null)
Base class for all types of elements.
Base class for all types of sets.
Represents a union of two sets.
override string ToString()
UnionSet(ISet Set1, ISet Set2)
Represents a union of two sets.
override int GetHashCode()
Calculates a hash code of the element.
override bool Contains(IElement Element)
Checks if the set contains an element.
override? int Size
Size of set, if finite and known, otherwise null is returned.
override bool Equals(object obj)
Compares the element to another.
override object AssociatedObjectValue
Associated object value.
override ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
Basic interface for all types of sets.