From b5688a799d6b55848ae85f2a02ea34345f7c9af6 Mon Sep 17 00:00:00 2001 From: lgoubet Date: Wed, 3 Aug 2011 11:44:21 +0200 Subject: Enhancing "test" metamodel with single and multi-valued attributes --- .../emf/compare/tests/merge/MergeFactory.java | 18 +++ .../emf/compare/tests/merge/MergePackage.java | 171 ++++++++++++++++++++ .../tests/merge/NodeMultiValuedAttribute.java | 55 +++++++ .../tests/merge/NodeSingleValueAttribute.java | 64 ++++++++ .../compare/tests/merge/impl/MergeFactoryImpl.java | 22 +++ .../compare/tests/merge/impl/MergePackageImpl.java | 66 ++++++++ .../merge/impl/NodeMultiValuedAttributeImpl.java | 162 +++++++++++++++++++ .../merge/impl/NodeSingleValueAttributeImpl.java | 177 +++++++++++++++++++++ .../tests/merge/util/MergeAdapterFactory.java | 36 +++++ .../emf/compare/tests/merge/util/MergeSwitch.java | 44 +++++ 10 files changed, 815 insertions(+) create mode 100644 plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeMultiValuedAttribute.java create mode 100644 plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeSingleValueAttribute.java create mode 100644 plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeMultiValuedAttributeImpl.java create mode 100644 plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeSingleValueAttributeImpl.java (limited to 'plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse') diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergeFactory.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergeFactory.java index bd5267055..e60758981 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergeFactory.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergeFactory.java @@ -63,6 +63,24 @@ public interface MergeFactory extends EFactory { */ NodeSingleValueContainment createNodeSingleValueContainment(); + /** + * Returns a new object of class 'Node Single Value Attribute'. + * + * + * @return a new object of class 'Node Single Value Attribute'. + * @generated + */ + NodeSingleValueAttribute createNodeSingleValueAttribute(); + + /** + * Returns a new object of class 'Node Multi Valued Attribute'. + * + * + * @return a new object of class 'Node Multi Valued Attribute'. + * @generated + */ + NodeMultiValuedAttribute createNodeMultiValuedAttribute(); + /** * Returns the package supported by this factory. * diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergePackage.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergePackage.java index 1753ada89..679804b47 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergePackage.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/MergePackage.java @@ -201,6 +201,99 @@ public interface MergePackage extends EPackage { int NODE_SINGLE_VALUE_CONTAINMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + /** + * The meta object id for the '{@link org.eclipse.emf.compare.tests.merge.impl.NodeSingleValueAttributeImpl Node Single Value Attribute}' class. + * + * + * @see org.eclipse.emf.compare.tests.merge.impl.NodeSingleValueAttributeImpl + * @see org.eclipse.emf.compare.tests.merge.impl.MergePackageImpl#getNodeSingleValueAttribute() + * @generated + */ + int NODE_SINGLE_VALUE_ATTRIBUTE = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int NODE_SINGLE_VALUE_ATTRIBUTE__NAME = NODE__NAME; + + /** + * The feature id for the 'Containment Ref1' containment reference list. + * + * + * @generated + * @ordered + */ + int NODE_SINGLE_VALUE_ATTRIBUTE__CONTAINMENT_REF1 = NODE__CONTAINMENT_REF1; + + /** + * The feature id for the 'Single Valued Attribute' attribute. + * + * + * @generated + * @ordered + */ + int NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Node Single Value Attribute' class. + * + * + * @generated + * @ordered + */ + int NODE_SINGLE_VALUE_ATTRIBUTE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.tests.merge.impl.NodeMultiValuedAttributeImpl Node Multi Valued Attribute}' class. + * + * + * @see org.eclipse.emf.compare.tests.merge.impl.NodeMultiValuedAttributeImpl + * @see org.eclipse.emf.compare.tests.merge.impl.MergePackageImpl#getNodeMultiValuedAttribute() + * @generated + */ + int NODE_MULTI_VALUED_ATTRIBUTE = 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int NODE_MULTI_VALUED_ATTRIBUTE__NAME = NODE__NAME; + + /** + * The feature id for the 'Containment Ref1' containment reference list. + * + * + * @generated + * @ordered + */ + int NODE_MULTI_VALUED_ATTRIBUTE__CONTAINMENT_REF1 = NODE__CONTAINMENT_REF1; + + /** + * The feature id for the 'Multi Valued Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Node Multi Valued Attribute' class. + * + * + * @generated + * @ordered + */ + int NODE_MULTI_VALUED_ATTRIBUTE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** * Returns the meta object for class '{@link org.eclipse.emf.compare.tests.merge.Node Node}'. * @@ -275,6 +368,48 @@ public interface MergePackage extends EPackage { */ EReference getNodeSingleValueContainment_SingleValueContainment(); + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute Node Single Value Attribute}'. + * + * + * @return the meta object for class 'Node Single Value Attribute'. + * @see org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute + * @generated + */ + EClass getNodeSingleValueAttribute(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute#getSingleValuedAttribute Single Valued Attribute}'. + * + * + * @return the meta object for the attribute 'Single Valued Attribute'. + * @see org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute#getSingleValuedAttribute() + * @see #getNodeSingleValueAttribute() + * @generated + */ + EAttribute getNodeSingleValueAttribute_SingleValuedAttribute(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute Node Multi Valued Attribute}'. + * + * + * @return the meta object for class 'Node Multi Valued Attribute'. + * @see org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute + * @generated + */ + EClass getNodeMultiValuedAttribute(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute#getMultiValuedAttribute Multi Valued Attribute}'. + * + * + * @return the meta object for the attribute list 'Multi Valued Attribute'. + * @see org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute#getMultiValuedAttribute() + * @see #getNodeMultiValuedAttribute() + * @generated + */ + EAttribute getNodeMultiValuedAttribute_MultiValuedAttribute(); + /** * Returns the factory that creates the instances of the model. * @@ -359,6 +494,42 @@ public interface MergePackage extends EPackage { */ EReference NODE_SINGLE_VALUE_CONTAINMENT__SINGLE_VALUE_CONTAINMENT = eINSTANCE.getNodeSingleValueContainment_SingleValueContainment(); + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.tests.merge.impl.NodeSingleValueAttributeImpl Node Single Value Attribute}' class. + * + * + * @see org.eclipse.emf.compare.tests.merge.impl.NodeSingleValueAttributeImpl + * @see org.eclipse.emf.compare.tests.merge.impl.MergePackageImpl#getNodeSingleValueAttribute() + * @generated + */ + EClass NODE_SINGLE_VALUE_ATTRIBUTE = eINSTANCE.getNodeSingleValueAttribute(); + + /** + * The meta object literal for the 'Single Valued Attribute' attribute feature. + * + * + * @generated + */ + EAttribute NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE = eINSTANCE.getNodeSingleValueAttribute_SingleValuedAttribute(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.tests.merge.impl.NodeMultiValuedAttributeImpl Node Multi Valued Attribute}' class. + * + * + * @see org.eclipse.emf.compare.tests.merge.impl.NodeMultiValuedAttributeImpl + * @see org.eclipse.emf.compare.tests.merge.impl.MergePackageImpl#getNodeMultiValuedAttribute() + * @generated + */ + EClass NODE_MULTI_VALUED_ATTRIBUTE = eINSTANCE.getNodeMultiValuedAttribute(); + + /** + * The meta object literal for the 'Multi Valued Attribute' attribute list feature. + * + * + * @generated + */ + EAttribute NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE = eINSTANCE.getNodeMultiValuedAttribute_MultiValuedAttribute(); + } } //MergePackage diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeMultiValuedAttribute.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeMultiValuedAttribute.java new file mode 100644 index 000000000..386f7c2c4 --- /dev/null +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeMultiValuedAttribute.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2011 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.compare.tests.merge; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Node Multi Valued Attribute'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @see org.eclipse.emf.compare.tests.merge.MergePackage#getNodeMultiValuedAttribute() + * @model + * @generated + */ +public interface NodeMultiValuedAttribute extends Node { + /** + * + * + * @generated + */ + String copyright = "Copyright (c) 2011 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ + + /** + * Returns the value of the 'Multi Valued Attribute' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'Multi Valued Attribute' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Multi Valued Attribute' attribute list. + * @see org.eclipse.emf.compare.tests.merge.MergePackage#getNodeMultiValuedAttribute_MultiValuedAttribute() + * @model + * @generated + */ + EList getMultiValuedAttribute(); + +} // NodeMultiValuedAttribute diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeSingleValueAttribute.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeSingleValueAttribute.java new file mode 100644 index 000000000..604f5c494 --- /dev/null +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/NodeSingleValueAttribute.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2011 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.compare.tests.merge; + + +/** + * + * A representation of the model object 'Node Single Value Attribute'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @see org.eclipse.emf.compare.tests.merge.MergePackage#getNodeSingleValueAttribute() + * @model + * @generated + */ +public interface NodeSingleValueAttribute extends Node { + /** + * + * + * @generated + */ + String copyright = "Copyright (c) 2011 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ + + /** + * Returns the value of the 'Single Valued Attribute' attribute. + * + *

+ * If the meaning of the 'Single Valued Attribute' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Single Valued Attribute' attribute. + * @see #setSingleValuedAttribute(String) + * @see org.eclipse.emf.compare.tests.merge.MergePackage#getNodeSingleValueAttribute_SingleValuedAttribute() + * @model + * @generated + */ + String getSingleValuedAttribute(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute#getSingleValuedAttribute Single Valued Attribute}' attribute. + * + * + * @param value the new value of the 'Single Valued Attribute' attribute. + * @see #getSingleValuedAttribute() + * @generated + */ + void setSingleValuedAttribute(String value); + +} // NodeSingleValueAttribute diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergeFactoryImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergeFactoryImpl.java index c7d972a4e..df1fc5fe7 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergeFactoryImpl.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergeFactoryImpl.java @@ -74,6 +74,8 @@ public class MergeFactoryImpl extends EFactoryImpl implements MergeFactory { case MergePackage.NODE: return createNode(); case MergePackage.NODE_MULTIPLE_CONTAINMENT: return createNodeMultipleContainment(); case MergePackage.NODE_SINGLE_VALUE_CONTAINMENT: return createNodeSingleValueContainment(); + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE: return createNodeSingleValueAttribute(); + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE: return createNodeMultiValuedAttribute(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -109,6 +111,26 @@ public class MergeFactoryImpl extends EFactoryImpl implements MergeFactory { return nodeSingleValueContainment; } + /** + * + * + * @generated + */ + public NodeSingleValueAttribute createNodeSingleValueAttribute() { + NodeSingleValueAttributeImpl nodeSingleValueAttribute = new NodeSingleValueAttributeImpl(); + return nodeSingleValueAttribute; + } + + /** + * + * + * @generated + */ + public NodeMultiValuedAttribute createNodeMultiValuedAttribute() { + NodeMultiValuedAttributeImpl nodeMultiValuedAttribute = new NodeMultiValuedAttributeImpl(); + return nodeMultiValuedAttribute; + } + /** * * diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergePackageImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergePackageImpl.java index c8c577a56..424a289ca 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergePackageImpl.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/MergePackageImpl.java @@ -13,8 +13,10 @@ package org.eclipse.emf.compare.tests.merge.impl; import org.eclipse.emf.compare.tests.merge.MergeFactory; import org.eclipse.emf.compare.tests.merge.MergePackage; import org.eclipse.emf.compare.tests.merge.Node; +import org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute; import org.eclipse.emf.compare.tests.merge.NodeMultipleContainment; +import org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute; import org.eclipse.emf.compare.tests.merge.NodeSingleValueContainment; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; @@ -58,6 +60,20 @@ public class MergePackageImpl extends EPackageImpl implements MergePackage { */ private EClass nodeSingleValueContainmentEClass = null; + /** + * + * + * @generated + */ + private EClass nodeSingleValueAttributeEClass = null; + + /** + * + * + * @generated + */ + private EClass nodeMultiValuedAttributeEClass = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -182,6 +198,42 @@ public class MergePackageImpl extends EPackageImpl implements MergePackage { return (EReference)nodeSingleValueContainmentEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EClass getNodeSingleValueAttribute() { + return nodeSingleValueAttributeEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getNodeSingleValueAttribute_SingleValuedAttribute() { + return (EAttribute)nodeSingleValueAttributeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getNodeMultiValuedAttribute() { + return nodeMultiValuedAttributeEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getNodeMultiValuedAttribute_MultiValuedAttribute() { + return (EAttribute)nodeMultiValuedAttributeEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -219,6 +271,12 @@ public class MergePackageImpl extends EPackageImpl implements MergePackage { nodeSingleValueContainmentEClass = createEClass(NODE_SINGLE_VALUE_CONTAINMENT); createEReference(nodeSingleValueContainmentEClass, NODE_SINGLE_VALUE_CONTAINMENT__SINGLE_VALUE_CONTAINMENT); + + nodeSingleValueAttributeEClass = createEClass(NODE_SINGLE_VALUE_ATTRIBUTE); + createEAttribute(nodeSingleValueAttributeEClass, NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE); + + nodeMultiValuedAttributeEClass = createEClass(NODE_MULTI_VALUED_ATTRIBUTE); + createEAttribute(nodeMultiValuedAttributeEClass, NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE); } /** @@ -251,6 +309,8 @@ public class MergePackageImpl extends EPackageImpl implements MergePackage { // Add supertypes to classes nodeMultipleContainmentEClass.getESuperTypes().add(this.getNode()); nodeSingleValueContainmentEClass.getESuperTypes().add(this.getNode()); + nodeSingleValueAttributeEClass.getESuperTypes().add(this.getNode()); + nodeMultiValuedAttributeEClass.getESuperTypes().add(this.getNode()); // Initialize classes and features; add operations and parameters initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ @@ -263,6 +323,12 @@ public class MergePackageImpl extends EPackageImpl implements MergePackage { initEClass(nodeSingleValueContainmentEClass, NodeSingleValueContainment.class, "NodeSingleValueContainment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEReference(getNodeSingleValueContainment_SingleValueContainment(), this.getNode(), null, "singleValueContainment", null, 0, 1, NodeSingleValueContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEClass(nodeSingleValueAttributeEClass, NodeSingleValueAttribute.class, "NodeSingleValueAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getNodeSingleValueAttribute_SingleValuedAttribute(), ecorePackage.getEString(), "singleValuedAttribute", null, 0, 1, NodeSingleValueAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(nodeMultiValuedAttributeEClass, NodeMultiValuedAttribute.class, "NodeMultiValuedAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getNodeMultiValuedAttribute_MultiValuedAttribute(), ecorePackage.getEString(), "multiValuedAttribute", null, 0, -1, NodeMultiValuedAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + // Create resource createResource(eNS_URI); } diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeMultiValuedAttributeImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeMultiValuedAttributeImpl.java new file mode 100644 index 000000000..ba4e4ccee --- /dev/null +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeMultiValuedAttributeImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) 2011 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.compare.tests.merge.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.compare.tests.merge.MergePackage; +import org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; + +/** + * + * An implementation of the model object 'Node Multi Valued Attribute'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class NodeMultiValuedAttributeImpl extends NodeImpl implements NodeMultiValuedAttribute { + /** + * + * + * @generated + */ + public static final String copyright = "Copyright (c) 2011 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ + + /** + * The cached value of the '{@link #getMultiValuedAttribute() Multi Valued Attribute}' attribute list. + * + * + * @see #getMultiValuedAttribute() + * @generated + * @ordered + */ + protected EList multiValuedAttribute; + + /** + * + * + * @generated + */ + protected NodeMultiValuedAttributeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return MergePackage.Literals.NODE_MULTI_VALUED_ATTRIBUTE; + } + + /** + * + * + * @generated + */ + public EList getMultiValuedAttribute() { + if (multiValuedAttribute == null) { + multiValuedAttribute = new EDataTypeUniqueEList(String.class, this, MergePackage.NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE); + } + return multiValuedAttribute; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE: + return getMultiValuedAttribute(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE: + getMultiValuedAttribute().clear(); + getMultiValuedAttribute().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE: + getMultiValuedAttribute().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE__MULTI_VALUED_ATTRIBUTE: + return multiValuedAttribute != null && !multiValuedAttribute.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (multiValuedAttribute: "); //$NON-NLS-1$ + result.append(multiValuedAttribute); + result.append(')'); + return result.toString(); + } + +} //NodeMultiValuedAttributeImpl diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeSingleValueAttributeImpl.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeSingleValueAttributeImpl.java new file mode 100644 index 000000000..c488391db --- /dev/null +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/impl/NodeSingleValueAttributeImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) 2011 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.compare.tests.merge.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.compare.tests.merge.MergePackage; +import org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Node Single Value Attribute'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.compare.tests.merge.impl.NodeSingleValueAttributeImpl#getSingleValuedAttribute Single Valued Attribute}
  • + *
+ *

+ * + * @generated + */ +public class NodeSingleValueAttributeImpl extends NodeImpl implements NodeSingleValueAttribute { + /** + * + * + * @generated + */ + public static final String copyright = "Copyright (c) 2011 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ + + /** + * The default value of the '{@link #getSingleValuedAttribute() Single Valued Attribute}' attribute. + * + * + * @see #getSingleValuedAttribute() + * @generated + * @ordered + */ + protected static final String SINGLE_VALUED_ATTRIBUTE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSingleValuedAttribute() Single Valued Attribute}' attribute. + * + * + * @see #getSingleValuedAttribute() + * @generated + * @ordered + */ + protected String singleValuedAttribute = SINGLE_VALUED_ATTRIBUTE_EDEFAULT; + + /** + * + * + * @generated + */ + protected NodeSingleValueAttributeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return MergePackage.Literals.NODE_SINGLE_VALUE_ATTRIBUTE; + } + + /** + * + * + * @generated + */ + public String getSingleValuedAttribute() { + return singleValuedAttribute; + } + + /** + * + * + * @generated + */ + public void setSingleValuedAttribute(String newSingleValuedAttribute) { + String oldSingleValuedAttribute = singleValuedAttribute; + singleValuedAttribute = newSingleValuedAttribute; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE, oldSingleValuedAttribute, singleValuedAttribute)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE: + return getSingleValuedAttribute(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE: + setSingleValuedAttribute((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE: + setSingleValuedAttribute(SINGLE_VALUED_ATTRIBUTE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE__SINGLE_VALUED_ATTRIBUTE: + return SINGLE_VALUED_ATTRIBUTE_EDEFAULT == null ? singleValuedAttribute != null : !SINGLE_VALUED_ATTRIBUTE_EDEFAULT.equals(singleValuedAttribute); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (singleValuedAttribute: "); //$NON-NLS-1$ + result.append(singleValuedAttribute); + result.append(')'); + return result.toString(); + } + +} //NodeSingleValueAttributeImpl diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeAdapterFactory.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeAdapterFactory.java index 95ad402a9..709883a00 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeAdapterFactory.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeAdapterFactory.java @@ -95,6 +95,14 @@ public class MergeAdapterFactory extends AdapterFactoryImpl { return createNodeSingleValueContainmentAdapter(); } @Override + public Adapter caseNodeSingleValueAttribute(NodeSingleValueAttribute object) { + return createNodeSingleValueAttributeAdapter(); + } + @Override + public Adapter caseNodeMultiValuedAttribute(NodeMultiValuedAttribute object) { + return createNodeMultiValuedAttributeAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -156,6 +164,34 @@ public class MergeAdapterFactory extends AdapterFactoryImpl { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute Node Single Value Attribute}'. + * + * 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 org.eclipse.emf.compare.tests.merge.NodeSingleValueAttribute + * @generated + */ + public Adapter createNodeSingleValueAttributeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute Node Multi Valued Attribute}'. + * + * 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 org.eclipse.emf.compare.tests.merge.NodeMultiValuedAttribute + * @generated + */ + public Adapter createNodeMultiValuedAttributeAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeSwitch.java b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeSwitch.java index a1c0d1c40..e86d30856 100644 --- a/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeSwitch.java +++ b/plugins/org.eclipse.emf.compare.tests/src-gen/org/eclipse/emf/compare/tests/merge/util/MergeSwitch.java @@ -101,6 +101,20 @@ public class MergeSwitch extends Switch { if (result == null) result = defaultCase(theEObject); return result; } + case MergePackage.NODE_SINGLE_VALUE_ATTRIBUTE: { + NodeSingleValueAttribute nodeSingleValueAttribute = (NodeSingleValueAttribute)theEObject; + T result = caseNodeSingleValueAttribute(nodeSingleValueAttribute); + if (result == null) result = caseNode(nodeSingleValueAttribute); + if (result == null) result = defaultCase(theEObject); + return result; + } + case MergePackage.NODE_MULTI_VALUED_ATTRIBUTE: { + NodeMultiValuedAttribute nodeMultiValuedAttribute = (NodeMultiValuedAttribute)theEObject; + T result = caseNodeMultiValuedAttribute(nodeMultiValuedAttribute); + if (result == null) result = caseNode(nodeMultiValuedAttribute); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -150,6 +164,36 @@ public class MergeSwitch extends Switch { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Node Single Value Attribute'. + * + * 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 'Node Single Value Attribute'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNodeSingleValueAttribute(NodeSingleValueAttribute object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Node Multi Valued Attribute'. + * + * 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 'Node Multi Valued Attribute'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNodeMultiValuedAttribute(NodeMultiValuedAttribute object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * -- cgit v1.2.3