Entry e = new Entry(hash, obj, copyOfEntries[index]); copyOfEntries[index] = e; count++;
/** * Returns a shallow copy of this <tt>IdentityHashSet</tt> (the * elements are not cloned). * * @return a shallow copy of this <tt>IdentityHashSet</tt>. */ public Object clone() { try { Entry[] copyOfEntries = entries; IdentityHashSet clone = (IdentityHashSet)super.clone(); clone.entries = new Entry[copyOfEntries.length]; for (int i = copyOfEntries.length; i-- > 0;) { clone.entries[i] = (copyOfEntries[i] != null) ? (Entry)copyOfEntries[i].clone() : null; } return clone; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
Entry e = new Entry(hash, obj, copyOfEntries[index]); copyOfEntries[index] = e; count++;
Entry e = new Entry(hash, obj, copyOfEntries[index]); copyOfEntries[index] = e; count++;
/** * Returns a shallow copy of this <tt>IdentityHashSet</tt> (the * elements are not cloned). * * @return a shallow copy of this <tt>IdentityHashSet</tt>. */ public Object clone() { try { Entry[] copyOfEntries = entries; IdentityHashSet clone = (IdentityHashSet)super.clone(); clone.entries = new Entry[copyOfEntries.length]; for (int i = copyOfEntries.length; i-- > 0;) { clone.entries[i] = (copyOfEntries[i] != null) ? (Entry)copyOfEntries[i].clone() : null; } return clone; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this <tt>IdentityHashSet</tt> (the * elements are not cloned). * * @return a shallow copy of this <tt>IdentityHashSet</tt>. */ public Object clone() { try { Entry[] copyOfEntries = entries; IdentityHashSet clone = (IdentityHashSet)super.clone(); clone.entries = new Entry[copyOfEntries.length]; for (int i = copyOfEntries.length; i-- > 0;) { clone.entries[i] = (copyOfEntries[i] != null) ? (Entry)copyOfEntries[i].clone() : null; } return clone; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
protected Object clone() { Entry currentNode = this; Entry rootNode = new Entry(hash, value, null); Entry currentNodeClone = rootNode; while (currentNode.next != null) { currentNodeClone.next = new Entry(currentNode.next.hash, currentNode.next.value, null); currentNode = currentNode.next; currentNodeClone = currentNodeClone.next; } return rootNode; } }
protected Object clone() { Entry currentNode = this; Entry rootNode = new Entry(hash, value, null); Entry currentNodeClone = rootNode; while (currentNode.next != null) { currentNodeClone.next = new Entry(currentNode.next.hash, currentNode.next.value, null); currentNode = currentNode.next; currentNodeClone = currentNodeClone.next; } return rootNode; } }
protected Object clone() { Entry currentNode = this; Entry rootNode = new Entry(hash, value, null); Entry currentNodeClone = rootNode; while (currentNode.next != null) { currentNodeClone.next = new Entry(currentNode.next.hash, currentNode.next.value, null); currentNode = currentNode.next; currentNodeClone = currentNodeClone.next; } return rootNode; } }