public static CompositeConstraint dupCompositeConstraint(CompositeConstraint ccSrc , ConstraintModel cmSrc
, HashMap<String,String> mName , HashMap<String,Feature> mFeature
, HashMap<String,Constraint> mConstraint , HashMap<String,CFRelation> mRelation
, ConstraintModelEditor cmeDest , CompositeConstraintEditor cceDest) {
CompositeConstraint result = cmeDest.addCompositeConstraint();
cceDest.setPLType(result , ccSrc.getPLType());
cceDest.setSourceType(result , ccSrc.getSourceType());
cceDest.setSinkType(result , ccSrc.getSinkType());
for (Iterator<Feature> itFeature=(Iterator<Feature>)ccSrc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
Feature fSrc = itFeature.next();
Feature fDest = mFeature.get(mName.get(fSrc.getID()));
cceDest.addSourceFeature(result , fDest);
CFRelation cfrSrc = cmSrc.getCFRelation(fSrc , ccSrc , true);
CFRelation cfrDest = cmeDest.addCFRelation(fDest , result , true , cfrSrc.getModifier());
mName.put(cfrSrc.getID() , cfrDest.getID());
mRelation.put(cfrDest.getID() , cfrDest);
}
for (Iterator<Feature> itFeature=(Iterator<Feature>)ccSrc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
Feature fSrc = itFeature.next();
Feature fDest = mFeature.get(mName.get(fSrc.getID()));
cceDest.addSinkFeature(result , fDest);
CFRelation cfrSrc = cmSrc.getCFRelation(fSrc , ccSrc , false);
CFRelation cfrDest = cmeDest.addCFRelation(fDest , result , false , cfrSrc.getModifier());
mName.put(cfrSrc.getID() , cfrDest.getID());
mRelation.put(cfrDest.getID() , cfrDest);
}
mName.put(ccSrc.getID() , result.getID());
mConstraint.put(result.getID() , result);
return result;
}