Esempio n. 1
0
        public Collection <K> keys()
        {
            Collection <K>     ks   = new Collection <K>();
            LinkMapNode <K, V> temp = head.next;

            for (; ;)
            {
                if (temp == tail)
                {
                    return(ks);
                }
                ks.Add(temp.getK());
                temp = temp.next;
            }
        }
Esempio n. 2
0
        public LinkMapNode <K, V> getNode(K key)
        {
            LinkMapNode <K, V> temp = tail.prev;

            for (; ;)
            {
                if (temp == head)
                {
                    return(null);
                }
                if (key.Equals(temp.getK()))
                {
                    return(temp);
                }
                temp = temp.prev;
            }
        }
Esempio n. 3
0
        public V get(K key)
        {
            LinkMapNode <K, V> temp = head.next;

            for (; ;)
            {
                if (temp == tail)
                {
                    return(default(V));
                }
                if (key.Equals(temp.getK()) && temp != tail && temp != head)
                {
                    return(temp.getV());
                }
                temp = temp.next;
            }
        }
Esempio n. 4
0
        public bool containsKey(K key)
        {
            LinkMapNode <K, V> temp = head.next;

            for (; ;)
            {
                if (temp == tail)
                {
                    return(false);
                }
                if (key.Equals(temp.getK()))
                {
                    return(true);
                }
                temp = temp.next;
            }
        }