2using System.Collections.Generic;
14 private readonly Dictionary<IElement, bool> elements;
22 this.elements =
new Dictionary<IElement, bool>();
24 this.elements[E] =
true;
34 return this.elements.ContainsKey(
Element);
42 public override bool Equals(
object obj)
47 if (this.elements.Count != S.elements.Count)
50 foreach (
IElement E
in this.elements.Keys)
52 if (!S.elements.ContainsKey(E))
67 foreach (
IElement E
in this.elements.Keys)
68 i ^= i << 5 ^ E.GetHashCode();
80 return this.elements.Keys;
87 StringBuilder sb =
null;
92 sb =
new StringBuilder(
"{");
104 return sb.ToString();
115 object[] Elements =
new object[this.elements.Count];
118 foreach (
IElement E
in this.elements.Keys)
130 get {
return this.elements.Count; }
Base class for all types of elements.
Base class for all types of sets.
FiniteSet(IEnumerable< IElement > 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.