14 private readonly Dictionary<IElement, bool> elements;
22 this.elements =
new Dictionary<IElement, bool>();
24 this.elements[E] =
true;
33 this.elements =
new Dictionary<IElement, bool>();
35 foreach (
object Item
in Elements)
38 this.elements[E] =
true;
49 return this.elements.ContainsKey(
Element);
57 public override bool Equals(
object obj)
62 if (this.elements.Count != S.elements.Count)
65 foreach (
IElement E
in this.elements.Keys)
67 if (!S.elements.ContainsKey(E))
82 foreach (
IElement E
in this.elements.Keys)
83 i ^= i << 5 ^ E.GetHashCode();
91 public override ICollection<IElement>
ChildElements => this.elements.Keys;
96 StringBuilder sb =
null;
101 sb =
new StringBuilder(
"{");
113 return sb.ToString();
124 object[] Elements =
new object[this.elements.Count];
127 foreach (
IElement E
in this.elements.Keys)
139 get {
return this.elements.Count; }
Base class for all types of elements.
Base class for all types of sets.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
FiniteSet(IEnumerable< IElement > Elements)
Represents a finite set.
FiniteSet(IEnumerable Elements)
Represents a finite set.
override object AssociatedObjectValue
Associated object value.
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 ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
override int GetHashCode()
Calculates a hash code of the element.
override bool Equals(object obj)
Compares the element to another.
override string ToString()
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.