/** * Returns a clone of this object * * @see <a href="../../../../api/com/novell/ldap/LDAPAttribute.html#clone()"> com.novell.ldap.LDAPAttribute.clone()</a> */ public Object clone() { try { Object newObj = super.clone(); ((LDAPAttribute)newObj).attr = (com.novell.ldap.LDAPAttribute)this.attr.clone(); return newObj; } catch( CloneNotSupportedException ce) { throw new RuntimeException("Internal error, cannot create clone"); } } }
/** * Returns a deep copy of this attribute set. * * @return A deep copy of this attribute set. */ public Object clone() { try { Object newObj = super.clone(); ((LDAPAttributeSet)newObj).clear(); Iterator i = this.iterator(); while (i.hasNext()){ ((LDAPAttributeSet)newObj).add( ((LDAPAttribute)i.next()).clone()); } return newObj; } catch( CloneNotSupportedException ce) { throw new RuntimeException("Internal error, cannot create clone"); } }
this.add( ((LDAPAttribute)i.next()).clone());
tempAttributeSet.add(attr.clone());