/** * Constructs a new <tt>IdentityHashSet</tt> with the same contents * as the given <tt>Collection</tt>. The new <tt>IdentityHashSet</tt> * is created with an initial capacity sufficient to hold the elements of * the given <tt>Collection</tt>. * * @param c the <tt>Collection</tt> whose contents are to be placed in the * new <tt>IdentityHashSet</tt>. */ public IdentityHashSet(Collection c) { this(Math.max((int)(c.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); addAll(c); }
/** * Constructs a new <tt>IdentityHashSet</tt> with the same contents * as the given <tt>Collection</tt>. The new <tt>IdentityHashSet</tt> * is created with an initial capacity sufficient to hold the elements of * the given <tt>Collection</tt>. * * @param c the <tt>Collection</tt> whose contents are to be placed in the * new <tt>IdentityHashSet</tt>. */ public IdentityHashSet(Collection c) { this(Math.max((int)(c.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); addAll(c); }
/** * Constructs a new <tt>IdentityHashSet</tt> with the same contents * as the given <tt>Collection</tt>. The new <tt>IdentityHashSet</tt> * is created with an initial capacity sufficient to hold the elements of * the given <tt>Collection</tt>. * * @param c the <tt>Collection</tt> whose contents are to be placed in the * new <tt>IdentityHashSet</tt>. */ public IdentityHashSet(Collection c) { this(Math.max((int)(c.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); addAll(c); }