public void copyDeepInfoInto(OJClassifier copy) { super.copyDeepInfoInto(copy); copy.setUniqueNumber(getUniqueNumber()); copy.setDerived(isDerived()); copy.setAbstract(isAbstract()); Iterator operationsIt = new ArrayList<OJOperation>(getOperations()).iterator(); while (operationsIt.hasNext()) { OJOperation elem = (OJOperation) operationsIt.next(); copy.addToOperations(elem.getDeepCopy()); } Iterator importsIt = new ArrayList<OJPathName>(getImports()).iterator(); while (importsIt.hasNext()) { OJPathName elem = (OJPathName) importsIt.next(); copy.addToImports(elem.getCopy()); } }
/** * Copies all attributes and associations of this instance into 'copy'. True parts, i.e. associations marked 'aggregate' or 'composite', * and attributes, are copied as well. References to other objects, i.e. associations not marked 'aggregate' or 'composite', will not be * copied. The 'copy' will refer to the same objects as the original (this) instance. * * @param copy */ public void copyInfoInto(OJClassifier copy){ super.copyInfoInto(copy); copy.setUniqueNumber(getUniqueNumber()); copy.setDerived(isDerived()); copy.setAbstract(isAbstract()); Iterator operationsIt = new ArrayList<OJOperation>(getOperations()).iterator(); while(operationsIt.hasNext()){ OJOperation elem = (OJOperation) operationsIt.next(); copy.addToOperations(elem); } Iterator importsIt = new ArrayList<OJPathName>(getImports()).iterator(); while(importsIt.hasNext()){ OJPathName elem = (OJPathName) importsIt.next(); copy.addToImports(elem); } } }