Example #1
0
        /// <summary>
        /// return a shallow copy of the HashMap instance
        /// the keys and values are not cloned
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            HashMap result = new HashMap();

            result.table    = new HashMapEntry[table.Length];
            result.modCount = 0;
            result.size     = 0;
            result.init();
            result.PutAllForCreate(this);

            return(result);
        }
Example #2
0
        /// <summary>
        /// return a shallow copy of the HashMap instance
        /// the keys and values are not cloned
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            HashMap result = new HashMap();

            result.table = new HashMapEntry[table.Length];
            result.modCount = 0;
            result.size = 0;
            result.init();
            result.PutAllForCreate(this);

            return result;
        }