コード例 #1
0
        public void add(K key, V val)
        {
            Dictonary <K, V> next = this.next;

            while (next.next != null)
            {
                next = next.next;
            }
            next.next = new Dictonary <K, V>(key, val);
        }
コード例 #2
0
        public V find(K key)
        {
            Dictonary <K, V> next = this.next;

            while (next != null)
            {
                if (next.key.Equals(key))
                {
                    return(next.value);
                }
                next = next.next;
            }
            return(default(V));
        }
コード例 #3
0
        public void remove(K key)
        {
            Dictonary <K, V> next = this.next;
            Dictonary <K, V> prev = this;

            while (next != null)
            {
                if (next.key.Equals(key))
                {
                    prev.next = next.next;
                    return;
                }
                prev = next;
                next = next.next;
            }
        }
コード例 #4
0
 Dictonary(K key, V val)
 {
     this.key   = key;
     this.value = val;
     this.next  = null;
 }
コード例 #5
0
 public Dictonary()
 {
     this.key   = default(K);
     this.value = default(V);
     this.next  = null;
 }