/** * Returns a shallow copy of this <code>IntHashMap</code> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this map. */ @Override public IntHashMap clone() { try { IntHashMap t = (IntHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0; ) { t.table[i] = (table[i] != null) ? (Entry) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this <code>IntHashMap</code> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this map. */ @Override public IntHashMap clone() { try { IntHashMap t = (IntHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0; ) { t.table[i] = (table[i] != null) ? (Entry) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this <code>IntHashMap</code> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this map. */ @Override public IntHashMap clone() { try { IntHashMap t = (IntHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0; ) { t.table[i] = (table[i] != null) ? (Entry) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this <code>IntHashMap</code> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this map. */ @Override public IntHashMap clone() { try { IntHashMap t = (IntHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0; ) { t.table[i] = (table[i] != null) ? (Entry) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
@Override protected Object clone() { return new Entry(key, value, (next == null ? null : (Entry) next.clone())); }
@Override protected Object clone() { return new Entry(key, value, (next == null ? null : (Entry) next.clone())); }
@Override protected Object clone() { return new Entry(key, value, (next == null ? null : (Entry) next.clone())); }
@Override protected Object clone() { return new Entry(key, value, (next == null ? null : (Entry) next.clone())); }