/** * Sets the value associated with the current key. * * @param value the new value * @return the previous value * @throws UnsupportedOperationException if setValue is not supported by the map * @throws IllegalStateException if <code>next()</code> has not yet been called * @throws IllegalStateException if <code>remove()</code> has been called since the * last call to <code>next()</code> */ public Object setValue(Object value) { if (last == null) { throw new java.lang.IllegalStateException("Iterator setValue() can only be called after next() and before remove()"); } return(last.setValue(value)); }
//----------------------------------------------------------------------- /** * Clones the map creating an independent copy. * <p> * The clone will shallow clone the collections as well as the map. * * @return the cloned map */ public Object clone() { MultiHashMap cloned = (MultiHashMap)base.MemberwiseClone(); // clone each Collection container for (java.util.Iterator <java.util.MapNS.Entry <Object, Object> > it = cloned.entrySet().iterator(); it.hasNext();) { java.util.MapNS.Entry <Object, Object> entry = it.next(); java.util.Collection <Object> coll = (java.util.Collection <Object>)entry.getValue(); java.util.Collection <Object> newColl = createCollection(coll); entry.setValue(newColl); } return(cloned); }
public virtual Object setValue(Object obj) { return(entry.setValue(obj)); }