Exemplo n.º 1
0
 internal Enumerator(OrderedHashSet <T> orderedHashSet)
 {
     this.orderedHashSet = orderedHashSet;
     index   = 0;
     Current = default;
     node    = orderedHashSet.order.First;
 }
Exemplo n.º 2
0
 protected void XOR_OrderedHashSet(OrderedHashSet <T> other)
 {
     foreach (T t in other)
     {
         if (!removeItem(t))
         {
             addItem(t);
         }
     }
 }
Exemplo n.º 3
0
 private bool ContainsAllElementsNicely(OrderedHashSet <T> other)
 {
     foreach (var t in other.order)
     {
         if (!containsItem(t))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 4
0
 private bool IsSubsetNicely(OrderedHashSet <T> other)
 {
     foreach (var key in lookup.Keys)
     {
         if (!other.lookup.ContainsKey(key))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 5
0
        private void IntersectNicely(OrderedHashSet <T> other)
        {
            LinkedListNode <T> curr = order.First;

            while (curr != null)
            {
                LinkedListNode <T> next = curr.Next;
                if (other.Contains(curr.Value))
                {
                    removeItem(curr.Value);
                }
                curr = next;
            }
        }
Exemplo n.º 6
0
 public ReadOnlyOrderedHashSet(OrderedHashSet <T> source)
 {
     sourceData = source ?? throw new ArgumentNullException(nameof(source));
 }
Exemplo n.º 7
0
 protected static bool EqualComparators(OrderedHashSet <T> first, OrderedHashSet <T> second)
 {
     return(first.lookup.Comparer.Equals(second.lookup.Comparer));
 }