From 775e76368b8826ec74b17196b5079c7a06a035ed Mon Sep 17 00:00:00 2001 From: 20001LastOrder Date: Mon, 24 Jun 2019 10:19:53 -0400 Subject: add sample domain for measuring realistic metrics --- .../encore_gen/socialnetwork/Person.java | 62 +++++ .../encore_gen/socialnetwork/SocialNetwork.java | 62 +++++ .../socialnetwork/SocialnetworkFactory.java | 51 ++++ .../socialnetwork/SocialnetworkPackage.java | 293 +++++++++++++++++++++ .../encore_gen/socialnetwork/impl/PersonImpl.java | 208 +++++++++++++++ .../socialnetwork/impl/SocialNetworkImpl.java | 228 ++++++++++++++++ .../impl/SocialnetworkFactoryImpl.java | 111 ++++++++ .../impl/SocialnetworkPackageImpl.java | 267 +++++++++++++++++++ .../util/SocialnetworkAdapterFactory.java | 138 ++++++++++ .../socialnetwork/util/SocialnetworkSwitch.java | 134 ++++++++++ 10 files changed, 1554 insertions(+) create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java (limited to 'Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork') diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java new file mode 100644 index 00000000..b1e0a041 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java @@ -0,0 +1,62 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Person'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see socialnetwork.SocialnetworkPackage#getPerson() + * @model + * @generated + */ +public interface Person extends EObject { + /** + * Returns the value of the 'Friends' reference list. + * The list contents are of type {@link socialnetwork.Person}. + * + * + * @return the value of the 'Friends' reference list. + * @see socialnetwork.SocialnetworkPackage#getPerson_Friends() + * @model + * @generated + */ + EList getFriends(); + + /** + * Returns the value of the 'Name' attribute. + * The default value is "Name". + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see socialnetwork.SocialnetworkPackage#getPerson_Name() + * @model default="Name" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link socialnetwork.Person#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Person diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java new file mode 100644 index 00000000..4653f6dd --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java @@ -0,0 +1,62 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Social Network'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork() + * @model + * @generated + */ +public interface SocialNetwork extends EObject { + /** + * Returns the value of the 'Name' attribute. + * The default value is "SocialNetwork". + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Name() + * @model default="SocialNetwork" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link socialnetwork.SocialNetwork#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Persons' containment reference list. + * The list contents are of type {@link socialnetwork.Person}. + * + * + * @return the value of the 'Persons' containment reference list. + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Persons() + * @model containment="true" + * @generated + */ + EList getPersons(); + +} // SocialNetwork diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java new file mode 100644 index 00000000..cf7a4250 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java @@ -0,0 +1,51 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public interface SocialnetworkFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SocialnetworkFactory eINSTANCE = socialnetwork.impl.SocialnetworkFactoryImpl.init(); + + /** + * Returns a new object of class 'Social Network'. + * + * + * @return a new object of class 'Social Network'. + * @generated + */ + SocialNetwork createSocialNetwork(); + + /** + * Returns a new object of class 'Person'. + * + * + * @return a new object of class 'Person'. + * @generated + */ + Person createPerson(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + SocialnetworkPackage getSocialnetworkPackage(); + +} //SocialnetworkFactory diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java new file mode 100644 index 00000000..f215f469 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java @@ -0,0 +1,293 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see socialnetwork.SocialnetworkFactory + * @model kind="package" + * annotation="http://www.eclipse.org/emf/2002/Ecore" + * @generated + */ +public interface SocialnetworkPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "socialnetwork"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://ecse.mcgill.ca/socialnetwork"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "socialnetwork"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + SocialnetworkPackage eINSTANCE = socialnetwork.impl.SocialnetworkPackageImpl.init(); + + /** + * The meta object id for the '{@link socialnetwork.impl.SocialNetworkImpl Social Network}' class. + * + * + * @see socialnetwork.impl.SocialNetworkImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() + * @generated + */ + int SOCIAL_NETWORK = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK__NAME = 0; + + /** + * The feature id for the 'Persons' containment reference list. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK__PERSONS = 1; + + /** + * The number of structural features of the 'Social Network' class. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Social Network' class. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link socialnetwork.impl.PersonImpl Person}' class. + * + * + * @see socialnetwork.impl.PersonImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() + * @generated + */ + int PERSON = 1; + + /** + * The feature id for the 'Friends' reference list. + * + * + * @generated + * @ordered + */ + int PERSON__FRIENDS = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PERSON__NAME = 1; + + /** + * The number of structural features of the 'Person' class. + * + * + * @generated + * @ordered + */ + int PERSON_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Person' class. + * + * + * @generated + * @ordered + */ + int PERSON_OPERATION_COUNT = 0; + + /** + * Returns the meta object for class '{@link socialnetwork.SocialNetwork Social Network}'. + * + * + * @return the meta object for class 'Social Network'. + * @see socialnetwork.SocialNetwork + * @generated + */ + EClass getSocialNetwork(); + + /** + * Returns the meta object for the attribute '{@link socialnetwork.SocialNetwork#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see socialnetwork.SocialNetwork#getName() + * @see #getSocialNetwork() + * @generated + */ + EAttribute getSocialNetwork_Name(); + + /** + * Returns the meta object for the containment reference list '{@link socialnetwork.SocialNetwork#getPersons Persons}'. + * + * + * @return the meta object for the containment reference list 'Persons'. + * @see socialnetwork.SocialNetwork#getPersons() + * @see #getSocialNetwork() + * @generated + */ + EReference getSocialNetwork_Persons(); + + /** + * Returns the meta object for class '{@link socialnetwork.Person Person}'. + * + * + * @return the meta object for class 'Person'. + * @see socialnetwork.Person + * @generated + */ + EClass getPerson(); + + /** + * Returns the meta object for the reference list '{@link socialnetwork.Person#getFriends Friends}'. + * + * + * @return the meta object for the reference list 'Friends'. + * @see socialnetwork.Person#getFriends() + * @see #getPerson() + * @generated + */ + EReference getPerson_Friends(); + + /** + * Returns the meta object for the attribute '{@link socialnetwork.Person#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see socialnetwork.Person#getName() + * @see #getPerson() + * @generated + */ + EAttribute getPerson_Name(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + SocialnetworkFactory getSocialnetworkFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link socialnetwork.impl.SocialNetworkImpl Social Network}' class. + * + * + * @see socialnetwork.impl.SocialNetworkImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() + * @generated + */ + EClass SOCIAL_NETWORK = eINSTANCE.getSocialNetwork(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SOCIAL_NETWORK__NAME = eINSTANCE.getSocialNetwork_Name(); + + /** + * The meta object literal for the 'Persons' containment reference list feature. + * + * + * @generated + */ + EReference SOCIAL_NETWORK__PERSONS = eINSTANCE.getSocialNetwork_Persons(); + + /** + * The meta object literal for the '{@link socialnetwork.impl.PersonImpl Person}' class. + * + * + * @see socialnetwork.impl.PersonImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() + * @generated + */ + EClass PERSON = eINSTANCE.getPerson(); + + /** + * The meta object literal for the 'Friends' reference list feature. + * + * + * @generated + */ + EReference PERSON__FRIENDS = eINSTANCE.getPerson_Friends(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PERSON__NAME = eINSTANCE.getPerson_Name(); + + } + +} //SocialnetworkPackage diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java new file mode 100644 index 00000000..d8bab731 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java @@ -0,0 +1,208 @@ +/** + */ +package socialnetwork.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import socialnetwork.Person; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model object 'Person'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link socialnetwork.impl.PersonImpl#getFriends Friends}
  • + *
  • {@link socialnetwork.impl.PersonImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PersonImpl extends MinimalEObjectImpl.Container implements Person { + /** + * The cached value of the '{@link #getFriends() Friends}' reference list. + * + * + * @see #getFriends() + * @generated + * @ordered + */ + protected EList friends; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = "Name"; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PersonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SocialnetworkPackage.Literals.PERSON; + } + + /** + * + * + * @generated + */ + @Override + public EList getFriends() { + if (friends == null) { + friends = new EObjectResolvingEList(Person.class, this, SocialnetworkPackage.PERSON__FRIENDS); + } + return friends; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.PERSON__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + return getFriends(); + case SocialnetworkPackage.PERSON__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + getFriends().clear(); + getFriends().addAll((Collection) newValue); + return; + case SocialnetworkPackage.PERSON__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + getFriends().clear(); + return; + case SocialnetworkPackage.PERSON__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + return friends != null && !friends.isEmpty(); + case SocialnetworkPackage.PERSON__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PersonImpl diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java new file mode 100644 index 00000000..cb28b749 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java @@ -0,0 +1,228 @@ +/** + */ +package socialnetwork.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import socialnetwork.Person; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model object 'Social Network'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link socialnetwork.impl.SocialNetworkImpl#getName Name}
  • + *
  • {@link socialnetwork.impl.SocialNetworkImpl#getPersons Persons}
  • + *
+ * + * @generated + */ +public class SocialNetworkImpl extends MinimalEObjectImpl.Container implements SocialNetwork { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = "SocialNetwork"; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getPersons() Persons}' containment reference list. + * + * + * @see #getPersons() + * @generated + * @ordered + */ + protected EList persons; + + /** + * + * + * @generated + */ + protected SocialNetworkImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SocialnetworkPackage.Literals.SOCIAL_NETWORK; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.SOCIAL_NETWORK__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @Override + public EList getPersons() { + if (persons == null) { + persons = new EObjectContainmentEList(Person.class, this, + SocialnetworkPackage.SOCIAL_NETWORK__PERSONS); + } + return persons; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return ((InternalEList) getPersons()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + return getName(); + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return getPersons(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + setName((String) newValue); + return; + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + getPersons().clear(); + getPersons().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + setName(NAME_EDEFAULT); + return; + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + getPersons().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return persons != null && !persons.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //SocialNetworkImpl diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java new file mode 100644 index 00000000..87fa3a87 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java @@ -0,0 +1,111 @@ +/** + */ +package socialnetwork.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import socialnetwork.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class SocialnetworkFactoryImpl extends EFactoryImpl implements SocialnetworkFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static SocialnetworkFactory init() { + try { + SocialnetworkFactory theSocialnetworkFactory = (SocialnetworkFactory) EPackage.Registry.INSTANCE + .getEFactory(SocialnetworkPackage.eNS_URI); + if (theSocialnetworkFactory != null) { + return theSocialnetworkFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new SocialnetworkFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SocialnetworkFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case SocialnetworkPackage.SOCIAL_NETWORK: + return createSocialNetwork(); + case SocialnetworkPackage.PERSON: + return createPerson(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public SocialNetwork createSocialNetwork() { + SocialNetworkImpl socialNetwork = new SocialNetworkImpl(); + return socialNetwork; + } + + /** + * + * + * @generated + */ + @Override + public Person createPerson() { + PersonImpl person = new PersonImpl(); + return person; + } + + /** + * + * + * @generated + */ + @Override + public SocialnetworkPackage getSocialnetworkPackage() { + return (SocialnetworkPackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static SocialnetworkPackage getPackage() { + return SocialnetworkPackage.eINSTANCE; + } + +} //SocialnetworkFactoryImpl diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java new file mode 100644 index 00000000..7588df50 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java @@ -0,0 +1,267 @@ +/** + */ +package socialnetwork.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import socialnetwork.Person; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkFactory; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class SocialnetworkPackageImpl extends EPackageImpl implements SocialnetworkPackage { + /** + * + * + * @generated + */ + private EClass socialNetworkEClass = null; + + /** + * + * + * @generated + */ + private EClass personEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see socialnetwork.SocialnetworkPackage#eNS_URI + * @see #init() + * @generated + */ + private SocialnetworkPackageImpl() { + super(eNS_URI, SocialnetworkFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link SocialnetworkPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static SocialnetworkPackage init() { + if (isInited) + return (SocialnetworkPackage) EPackage.Registry.INSTANCE.getEPackage(SocialnetworkPackage.eNS_URI); + + // Obtain or create and register package + Object registeredSocialnetworkPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + SocialnetworkPackageImpl theSocialnetworkPackage = registeredSocialnetworkPackage instanceof SocialnetworkPackageImpl + ? (SocialnetworkPackageImpl) registeredSocialnetworkPackage + : new SocialnetworkPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theSocialnetworkPackage.createPackageContents(); + + // Initialize created meta-data + theSocialnetworkPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theSocialnetworkPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(SocialnetworkPackage.eNS_URI, theSocialnetworkPackage); + return theSocialnetworkPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getSocialNetwork() { + return socialNetworkEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSocialNetwork_Name() { + return (EAttribute) socialNetworkEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSocialNetwork_Persons() { + return (EReference) socialNetworkEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPerson() { + return personEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPerson_Friends() { + return (EReference) personEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPerson_Name() { + return (EAttribute) personEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public SocialnetworkFactory getSocialnetworkFactory() { + return (SocialnetworkFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + socialNetworkEClass = createEClass(SOCIAL_NETWORK); + createEAttribute(socialNetworkEClass, SOCIAL_NETWORK__NAME); + createEReference(socialNetworkEClass, SOCIAL_NETWORK__PERSONS); + + personEClass = createEClass(PERSON); + createEReference(personEClass, PERSON__FRIENDS); + createEAttribute(personEClass, PERSON__NAME); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(socialNetworkEClass, SocialNetwork.class, "SocialNetwork", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSocialNetwork_Name(), ecorePackage.getEString(), "name", "SocialNetwork", 0, 1, + SocialNetwork.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getSocialNetwork_Persons(), this.getPerson(), null, "persons", null, 0, -1, SocialNetwork.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPerson_Friends(), this.getPerson(), null, "friends", null, 0, -1, Person.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", "Name", 0, 1, Person.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + } + + /** + * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore. + * + * + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation(this, source, new String[] {}); + } + +} //SocialnetworkPackageImpl diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java new file mode 100644 index 00000000..0dd30975 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java @@ -0,0 +1,138 @@ +/** + */ +package socialnetwork.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import socialnetwork.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public class SocialnetworkAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static SocialnetworkPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public SocialnetworkAdapterFactory() { + if (modelPackage == null) { + modelPackage = SocialnetworkPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected SocialnetworkSwitch modelSwitch = new SocialnetworkSwitch() { + @Override + public Adapter caseSocialNetwork(SocialNetwork object) { + return createSocialNetworkAdapter(); + } + + @Override + public Adapter casePerson(Person object) { + return createPersonAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link socialnetwork.SocialNetwork Social Network}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see socialnetwork.SocialNetwork + * @generated + */ + public Adapter createSocialNetworkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link socialnetwork.Person Person}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see socialnetwork.Person + * @generated + */ + public Adapter createPersonAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //SocialnetworkAdapterFactory diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java new file mode 100644 index 00000000..00d7955c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java @@ -0,0 +1,134 @@ +/** + */ +package socialnetwork.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import socialnetwork.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public class SocialnetworkSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static SocialnetworkPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public SocialnetworkSwitch() { + if (modelPackage == null) { + modelPackage = SocialnetworkPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case SocialnetworkPackage.SOCIAL_NETWORK: { + SocialNetwork socialNetwork = (SocialNetwork) theEObject; + T result = caseSocialNetwork(socialNetwork); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SocialnetworkPackage.PERSON: { + Person person = (Person) theEObject; + T result = casePerson(person); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Social Network'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Social Network'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSocialNetwork(SocialNetwork object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Person'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Person'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePerson(Person object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //SocialnetworkSwitch -- cgit v1.2.3-70-g09d2