Ejemplo n.º 1
0
        /** Construct a new, empty IdentityHashSet whose backing IdentityHashMap
         *  has the specified expected maximum size.  Putting more than the
         *  expected number of elements into the set may cause the internal data
         *  structure to grow, which may be somewhat time-consuming.
         *
         * @param expectedMaxSize the expected maximum size of the set.
         */
        /*public IdentityHashSet(int expectedMaxSize) {
         * map = new IdentityDictionary<T, Boolean>(expectedMaxSize);
         * }*/

        /// <summary>
        /// Construct a new IdentityHashSet with the same elements as the supplied
        /// Collection (eliminating any duplicates, of course); the backing
        /// IdentityHashMap will have the default expected maximum size (21).
        /// </summary>
        /// <param name="c">
        /// a Collection containing the elements with which this set will be initialized.
        /// </param>
        public IdentityHashSet(ICollection <T> c)
        {
            map = new IdentityDictionary <T, Boolean>();
            AddAll(c);
        }
Ejemplo n.º 2
0
        // CONSTRUCTORS ---------------------------------------------------------

        /** Construct a new, empty IdentityHashSet whose backing IdentityHashMap
         *  has the default expected maximum size (21);
         */

        public IdentityHashSet()
        {
            map = new IdentityDictionary <T, Boolean>();
        }