Пример #1
0
 private void PutAllForCreate(GenericHashMap <K, V> m)
 {
     for (IEnumerator <IHashMapEntry <K, V> > i = m.GetEnumerator(); i.MoveNext();)
     {
         IHashMapEntry <K, V> e = i.Current;
         PutForCreate(e.Key, e.Value);
     }
 }
Пример #2
0
        /// <summary>
        /// return a shallow copy of the HashMap instance
        /// the keys and values are not cloned
        /// </summary>
        /// <returns></returns>
        public GenericHashMap <K, V> Clone()
        {
            GenericHashMap <K, V> result = new GenericHashMap <K, V>();

            result.table    = new HashMapEntry <K, V> [table.Length];
            result.modCount = 0;
            result.size     = 0;
            result.init();
            result.PutAllForCreate(this);

            return(result);
        }
Пример #3
0
            private IHashMapEntry <K, V> _next;    // next entry to return

            internal HashEnumerator(GenericHashMap <K, V> theMap)
            {
                _map = theMap;
                _expectedModCount = _map.modCount;
                IHashMapEntry <K, V>[] t = theMap.table;
                int i = t.Length;
                IHashMapEntry <K, V> n = null;

                if (theMap.size != 0)
                {
                    // advance to first entry
                    while (i > 0 && (n = t[--i]) == null)
                    {
                        ;
                    }
                }
                _next  = n;
                _index = i;
            }
Пример #4
0
 public EntrySet(GenericHashMap <K, V> theMap)
 {
     _map = theMap;
 }
Пример #5
0
 public EntryEnumerator(GenericHashMap <K, V> h) : base(h)
 {
 }
Пример #6
0
 public ValueEnumerator(GenericHashMap <K, V> h) : base(h)
 {
 }
Пример #7
0
 public HashMapValues(GenericHashMap <K, V> map)
 {
     this.map = map;
 }
Пример #8
0
 public HashMapKeys(GenericHashMap <K, V> map)
 {
     this.map = map;
 }