예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #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;
            }
        }