Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java')
-rw-r--r--extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java122
1 files changed, 75 insertions, 47 deletions
diff --git a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java
index 5a176c8d4fc..ada3029ae2f 100644
--- a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java
+++ b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/featuremodeling/impl/FeatureGroupImpl.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* 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
@@ -38,9 +38,9 @@ import org.eclipse.uml2.uml.util.UMLUtil;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getBase_Class <em>Base Class</em>}</li>
- * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getCardinality <em>Cardinality</em>}</li>
- * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getChildFeature <em>Child Feature</em>}</li>
+ * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getBase_Class <em>Base Class</em>}</li>
+ * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getCardinality <em>Cardinality</em>}</li>
+ * <li>{@link org.eclipse.papyrus.eastadl.structure.featuremodeling.impl.FeatureGroupImpl#getChildFeature <em>Child Feature</em>}</li>
* </ul>
* </p>
*
@@ -52,6 +52,7 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
* The cached value of the '{@link #getBase_Class() <em>Base Class</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getBase_Class()
* @generated
* @ordered
@@ -62,6 +63,7 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
* The default value of the '{@link #getCardinality() <em>Cardinality</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getCardinality()
* @generated
* @ordered
@@ -71,7 +73,7 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* The cached value of the '{@link #getCardinality() <em>Cardinality</em>}' attribute. <!--
* begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @see #getCardinality()
* @generated
* @ordered
@@ -80,6 +82,7 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected FeatureGroupImpl() {
@@ -88,63 +91,69 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
- if (resolve) return getBase_Class();
- return basicGetBase_Class();
- case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
- return getCardinality();
- case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
- return getChildFeature();
+ case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
+ if (resolve) {
+ return getBase_Class();
+ }
+ return basicGetBase_Class();
+ case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
+ return getCardinality();
+ case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
+ return getChildFeature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
- return base_Class != null;
- case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
- return CARDINALITY_EDEFAULT == null ? cardinality != null : !CARDINALITY_EDEFAULT.equals(cardinality);
- case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
- return !getChildFeature().isEmpty();
+ case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
+ return base_Class != null;
+ case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
+ return CARDINALITY_EDEFAULT == null ? cardinality != null : !CARDINALITY_EDEFAULT.equals(cardinality);
+ case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
+ return !getChildFeature().isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
- setBase_Class((org.eclipse.uml2.uml.Class)newValue);
- return;
- case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
- setCardinality((String)newValue);
- return;
- case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
- getChildFeature().clear();
- getChildFeature().addAll((Collection<? extends Feature>)newValue);
- return;
+ case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
+ setBase_Class((org.eclipse.uml2.uml.Class) newValue);
+ return;
+ case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
+ setCardinality((String) newValue);
+ return;
+ case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
+ getChildFeature().clear();
+ getChildFeature().addAll((Collection<? extends Feature>) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -155,15 +164,18 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
+ @Override
public org.eclipse.uml2.uml.Class getBase_Class() {
if (base_Class != null && base_Class.eIsProxy()) {
- InternalEObject oldBase_Class = (InternalEObject)base_Class;
- base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class);
+ InternalEObject oldBase_Class = (InternalEObject) base_Class;
+ base_Class = (org.eclipse.uml2.uml.Class) eResolveProxy(oldBase_Class);
if (base_Class != oldBase_Class) {
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS, oldBase_Class, base_Class));
+ }
}
}
return base_Class;
@@ -172,6 +184,7 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public org.eclipse.uml2.uml.Class basicGetBase_Class() {
@@ -181,84 +194,99 @@ public class FeatureGroupImpl extends FeatureTreeNodeImpl implements FeatureGrou
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
+ @Override
public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) {
org.eclipse.uml2.uml.Class oldBase_Class = base_Class;
base_Class = newBase_Class;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS, oldBase_Class, base_Class));
+ }
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
- setBase_Class((org.eclipse.uml2.uml.Class)null);
- return;
- case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
- setCardinality(CARDINALITY_EDEFAULT);
- return;
- case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
- getChildFeature().clear();
- return;
+ case FeaturemodelingPackage.FEATURE_GROUP__BASE_CLASS:
+ setBase_Class((org.eclipse.uml2.uml.Class) null);
+ return;
+ case FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY:
+ setCardinality(CARDINALITY_EDEFAULT);
+ return;
+ case FeaturemodelingPackage.FEATURE_GROUP__CHILD_FEATURE:
+ getChildFeature().clear();
+ return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
+ @Override
public String getCardinality() {
return cardinality;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated NOT
*/
+ @Override
public EList<Feature> getChildFeature() {
EList<Feature> results = new BasicEList<Feature>();
Feature adlFeature = null;
if (getBase_NamedElement() != null) {
Iterator<Element> it = getBase_NamedElement().getOwnedElements().iterator();
-
+
while (it.hasNext()) {
Element element = it.next();
- adlFeature = (Feature )UMLUtil.getStereotypeApplication(element, Feature.class);
- if (adlFeature != null)
+ adlFeature = UMLUtil.getStereotypeApplication(element, Feature.class);
+ if (adlFeature != null) {
results.add(adlFeature);
+ }
}
}
-
+
return new BasicInternalEList<Feature>(Feature.class, results.size(), results.toArray());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
+ @Override
public void setCardinality(String newCardinality) {
String oldCardinality = cardinality;
cardinality = newCardinality;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FeaturemodelingPackage.FEATURE_GROUP__CARDINALITY, oldCardinality, cardinality));
+ }
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) return super.toString();
+ if (eIsProxy()) {
+ return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (cardinality: ");

Back to the top