/** * Returns a deep copy of the receiver. * * @return a deep copy of the receiver. */ public Object clone() { OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) super.clone(); copy.table = (int[]) copy.table.clone(); copy.values = (double[]) copy.values.clone(); copy.state = (byte[]) copy.state.clone(); return copy; }
/** * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt>values to it. * * @param other the other map to be copied into the receiver. */ public void assign(AbstractIntDoubleMap other) { if (!(other instanceof OpenIntDoubleHashMap)) { super.assign(other); return; } OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other; OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy(); this.values = copy.values; this.table = copy.table; this.state = copy.state; this.freeEntries = copy.freeEntries; this.distinct = copy.distinct; this.lowWaterMark = copy.lowWaterMark; this.highWaterMark = copy.highWaterMark; this.minLoadFactor = copy.minLoadFactor; this.maxLoadFactor = copy.maxLoadFactor; }