Commit 06a7e2c3 authored by Erwan Bousse's avatar Erwan Bousse
Browse files

Versionning everything

parent cf54973e
/**
*/
package somemmmutclassonly;
import fr.inria.diverse.cloning.cloner.emfextension.impl.AbstractShareableEObject;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import somemetamodelextension.R;
import somemetamodelextension.SomemetamodelextensionPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>R</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* { @link somemetamodelextension.impl.RMutClassOnlyPImpl#getA_m <em>Am</em>}
* </li>
* <li>
* { @link somemetamodelextension.impl.RMutClassOnlyPImpl#getB <em>B</em>}
* </li>
* </ul>
* </p>
* @generated
*/
public class RMutClassOnlyPImpl extends AbstractShareableEObject implements R {
protected R cloned;
/**
* The default value of the '
* { @link #getA_m() <em>Am</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getA_m()
* @generated
* @ordered
*/
protected static final int AM_EDEFAULT = 0;
/**
* The cached value of the '
* { @link #getA_m() <em>Am</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getA_m()
* @generated
* @ordered
*/
protected int a_m = AM_EDEFAULT;
/**
* The default value of the '
* { @link #getB() <em>B</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getB()
* @generated
* @ordered
*/
protected static final int B_EDEFAULT = 0;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RMutClassOnlyPImpl(R clonedParam) {
super();
cloned = clonedParam;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SomemetamodelextensionPackage.Literals.R;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getA_m() {
return a_m;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setA_m(int newA_m) {
int oldA_m = a_m;
a_m = newA_m;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
SomemetamodelextensionPackage.R__AM, oldA_m, a_m));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getB() {
return cloned.getB();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setB(int newB) {
System.out
.println("[Info] RMutClassOnlyPImpl: b is readonly and cannot be set.");
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SomemetamodelextensionPackage.R__AM:
return getA_m();
case SomemetamodelextensionPackage.R__B:
return getB();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SomemetamodelextensionPackage.R__AM:
setA_m((Integer) newValue);
return;
case SomemetamodelextensionPackage.R__B:
setB((Integer) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SomemetamodelextensionPackage.R__AM:
setA_m(AM_EDEFAULT);
return;
case SomemetamodelextensionPackage.R__B:
setB(B_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SomemetamodelextensionPackage.R__AM:
return a_m != AM_EDEFAULT;
case SomemetamodelextensionPackage.R__B:
return cloned.getB() != B_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (a_m: ");
result.append(a_m);
result.append(", b: ");
result.append(cloned.getB());
result.append(')');
return result.toString();
}
}
//RImpl
package somemmmutclassonly;
import fr.inria.diverse.cloning.cloner.common.CloningMaterial;
import fr.inria.diverse.cloning.cloner.emfextension.impl.LooseCopier;
import fr.inria.diverse.cloning.cloner.common.MetamodelTags;
public class SomeMMMutClassOnlyCloningMaterial implements CloningMaterial {
private static SomeMMMutClassOnlyCloningMaterial instance;
private SomeMMMutClassOnlyTags tags;
private SomeMMMutClassOnlyCloningMaterial(SomeMMMutClassOnlyTags tags) {
this.tags = tags;
};
public static SomeMMMutClassOnlyCloningMaterial getInstance() {
if (instance == null)
instance = new SomeMMMutClassOnlyCloningMaterial(
new SomeMMMutClassOnlyTags());
return instance;
}
public MetamodelTags getTags() {
return tags;
}
public LooseCopier createLightCopier() {
return new SomeMMMutClassOnlyLightCopier();
}
}
package somemmmutclassonly;
import org.eclipse.emf.ecore.EObject;
import fr.inria.diverse.cloning.cloner.emfextension.impl.LooseCopier;
import somemetamodelextension.R;
import somemetamodel.A;
import somemetamodel.B;
@SuppressWarnings("serial")
public class SomeMMMutClassOnlyLightCopier extends LooseCopier {
protected EObject createCopy(EObject eObject) {
if (eObject instanceof R)
return new RMutClassOnlyPImpl((R) eObject);
if (eObject instanceof A)
return new AMutClassOnlyPImpl((A) eObject);
if (eObject instanceof B)
return new BMutClassOnlyPImpl((B) eObject);
else
return super.createCopy(eObject);
}
}
package somemmmutclassonly;
import org.eclipse.emf.ecore.EClass;
import fr.inria.diverse.cloning.cloner.common.ClassTag;
import fr.inria.diverse.cloning.cloner.common.MetamodelTags;
import org.eclipse.emf.ecore.EStructuralFeature;
import somemetamodelextension.hidden.Y;
import somemetamodelextension.X;
import somemetamodelextension.R;
import somemetamodelextension.hidden.Z;
import somemetamodel.A;
import somemetamodel.E;
import somemetamodel.B;
import somemetamodel.C;
import somemetamodel.D;
public class SomeMMMutClassOnlyTags implements MetamodelTags {
public ClassTag getTagOf(EClass eClass) {
if (eClass.equals(somemetamodelextension.hidden.HiddenPackage.eINSTANCE
.getY()))
return ClassTag.NOT_SHAREABLE;
if (eClass
.equals(somemetamodelextension.SomemetamodelextensionPackage.eINSTANCE
.getX()))
return ClassTag.COMPLETELY_SHAREABLE;
if (eClass
.equals(somemetamodelextension.SomemetamodelextensionPackage.eINSTANCE
.getR()))
return ClassTag.PARTIALLY_SHAREABLE;
if (eClass.equals(somemetamodelextension.hidden.HiddenPackage.eINSTANCE
.getZ()))
return ClassTag.NOT_SHAREABLE;
if (eClass.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA()))
return ClassTag.PARTIALLY_SHAREABLE;
if (eClass.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getE()))
return ClassTag.COMPLETELY_SHAREABLE;
if (eClass.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getB()))
return ClassTag.PARTIALLY_SHAREABLE;
if (eClass.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getC()))
return ClassTag.NOT_SHAREABLE;
if (eClass.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getD()))
return ClassTag.NOT_SHAREABLE;
else
return null;
}
public boolean mayTagClassesShareable() {
return true;
}
public boolean isPropertyShareable(EStructuralFeature prop) {
if (prop.equals(somemetamodelextension.hidden.HiddenPackage.eINSTANCE
.getY_Z()))
return false;
if (prop.equals(somemetamodelextension.SomemetamodelextensionPackage.eINSTANCE
.getR_A_m()))
return false;
if (prop.equals(somemetamodelextension.SomemetamodelextensionPackage.eINSTANCE
.getR_B()))
return true;
if (prop.equals(somemetamodelextension.hidden.HiddenPackage.eINSTANCE
.getZ_Y()))
return false;
if (prop.equals(somemetamodelextension.hidden.HiddenPackage.eINSTANCE
.getZ_I_m()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA_B()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA_C()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA_D()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA_E()))
return true;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getA_X()))
return true;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE
.getB_N1_m()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getB_N2()))
return true;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE
.getC_Yay_m()))
return false;
if (prop.equals(somemetamodel.SomemetamodelPackage.eINSTANCE.getD_A()))
return false;
else
return false;
}
public double getCompShareableClassesRatio() {
return 0.2222222222222222;
}
public double getPartShareableClassesRatio() {
return 0.3333333333333333;
}
public double getShareablePropertiesInShareableClassesRatio() {
return 0.14285714285714285;
}
public double getMeanShareablePropertiesInShareableClasses() {
return 0.6666666666666666;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TreeMetamodel</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//model/TreeMetamodel.ecorediag=UTF-8
encoding//model/TreeMetamodelExtension.ecore=UTF-8
encoding//model/TreeMetamodelExtension.ecorediag=UTF-8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: TreeMetamodel;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: treemetamodel,
treemetamodel.impl,
treemetamodel.util,
treemetamodelextension,
treemetamodelextension.impl,
treemetamodelextension.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport
Bundle-ActivationPolicy: lazy
Import-Package: fancyemfcloning.common
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment