Example #1
0
            public override void SwapValue(RBTree.Node other)
            {
                SortedDictionary <TKey, TValue> .Node node = (SortedDictionary <TKey, TValue> .Node)other;
                TKey key = this.key;

                this.key = node.key;
                node.key = key;
                TValue obj = this.value;

                this.value = node.value;
                node.value = obj;
            }
Example #2
0
        public void Add(TKey key, TValue value)
        {
            if ((object)key == null)
            {
                throw new ArgumentNullException("key");
            }
            RBTree.Node new_node = (RBTree.Node) new SortedDictionary <TKey, TValue> .Node(key, value);

            if (this.tree.Intern <TKey>(key, new_node) != new_node)
            {
                throw new ArgumentException("key already present in dictionary", "key");
            }
        }
Example #3
0
 public int Compare(TKey key, RBTree.Node node)
 {
     return(this.cmp.Compare(key, ((SortedDictionary <TKey, TValue> .Node)node).key));
 }
Example #4
0
 public abstract void SwapValue(RBTree.Node other);