diff options
Diffstat (limited to 'extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java')
-rw-r--r-- | extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java | 307 |
1 files changed, 80 insertions, 227 deletions
diff --git a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java index 7102e93ac44..bde4483c655 100644 --- a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java +++ b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/structure/hardwaremodeling/impl/HardwarePinImpl.java @@ -19,6 +19,8 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.eastadl.infrastructure.elements.EAPort; +import org.eclipse.papyrus.eastadl.infrastructure.elements.ElementsPackage; import org.eclipse.papyrus.eastadl.infrastructure.elements.impl.EAElementImpl; import org.eclipse.papyrus.eastadl.structure.functionmodeling.EADirectionKind; import org.eclipse.papyrus.eastadl.structure.hardwaremodeling.HardwarePin; @@ -32,15 +34,12 @@ import org.eclipse.uml2.uml.Port; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getBase_Port <em>Base Port</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#isIsGround <em>Is Ground</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getVoltage <em>Voltage</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getDirection <em>Direction</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getImpedance <em>Impedance</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getPower <em>Power</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getBase_Port <em>Base Port</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#isIsGround <em>Is Ground</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.structure.hardwaremodeling.impl.HardwarePinImpl#getDirection <em>Direction</em>}</li> * </ul> * </p> - * + * * @generated */ public abstract class HardwarePinImpl extends EAElementImpl implements HardwarePin { @@ -49,7 +48,6 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP * The cached value of the '{@link #getBase_Port() <em>Base Port</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * * @see #getBase_Port() * @generated * @ordered @@ -77,26 +75,6 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP protected boolean isGround = IS_GROUND_EDEFAULT; /** - * The default value of the '{@link #getVoltage() <em>Voltage</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getVoltage() - * @generated - * @ordered - */ - protected static final Float VOLTAGE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getVoltage() <em>Voltage</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getVoltage() - * @generated - * @ordered - */ - protected Float voltage = VOLTAGE_EDEFAULT; - - /** * The default value of the '{@link #getDirection() <em>Direction</em>}' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -117,50 +95,7 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP protected EADirectionKind direction = DIRECTION_EDEFAULT; /** - * The default value of the '{@link #getImpedance() <em>Impedance</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getImpedance() - * @generated - * @ordered - */ - protected static final Float IMPEDANCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getImpedance() <em>Impedance</em>}' attribute. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @see #getImpedance() - * @generated - * @ordered - */ - protected Float impedance = IMPEDANCE_EDEFAULT; - - /** - * The default value of the '{@link #getPower() <em>Power</em>}' attribute. - * <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @see #getPower() - * @generated - * @ordered - */ - protected static final Float POWER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPower() <em>Power</em>}' attribute. - * <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @see #getPower() - * @generated - * @ordered - */ - protected Float power = POWER_EDEFAULT; - - /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ protected HardwarePinImpl() { @@ -169,87 +104,93 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch(featureID) { - case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: - if(resolve) - return getBase_Port(); - return basicGetBase_Port(); - case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: - return isIsGround(); - case HardwaremodelingPackage.HARDWARE_PIN__VOLTAGE: - return getVoltage(); - case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: - return getDirection(); - case HardwaremodelingPackage.HARDWARE_PIN__IMPEDANCE: - return getImpedance(); - case HardwaremodelingPackage.HARDWARE_PIN__POWER: - return getPower(); + switch (featureID) { + case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: + if (resolve) return getBase_Port(); + return basicGetBase_Port(); + case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: + return isIsGround(); + case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: + return getDirection(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ @Override public boolean eIsSet(int featureID) { - switch(featureID) { - case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: - return base_Port != null; - case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: - return isGround != IS_GROUND_EDEFAULT; - case HardwaremodelingPackage.HARDWARE_PIN__VOLTAGE: - return VOLTAGE_EDEFAULT == null ? voltage != null : !VOLTAGE_EDEFAULT.equals(voltage); - case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: - return direction != DIRECTION_EDEFAULT; - case HardwaremodelingPackage.HARDWARE_PIN__IMPEDANCE: - return IMPEDANCE_EDEFAULT == null ? impedance != null : !IMPEDANCE_EDEFAULT.equals(impedance); - case HardwaremodelingPackage.HARDWARE_PIN__POWER: - return POWER_EDEFAULT == null ? power != null : !POWER_EDEFAULT.equals(power); + switch (featureID) { + case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: + return base_Port != null; + case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: + return isGround != IS_GROUND_EDEFAULT; + case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: + return direction != DIRECTION_EDEFAULT; } return super.eIsSet(featureID); } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { + if (baseClass == EAPort.class) { + switch (derivedFeatureID) { + case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: return ElementsPackage.EA_PORT__BASE_PORT; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { + if (baseClass == EAPort.class) { + switch (baseFeatureID) { + case ElementsPackage.EA_PORT__BASE_PORT: return HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ @Override public void eSet(int featureID, Object newValue) { - switch(featureID) { - case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: - setBase_Port((Port)newValue); - return; - case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: - setIsGround((Boolean)newValue); - return; - case HardwaremodelingPackage.HARDWARE_PIN__VOLTAGE: - setVoltage((Float)newValue); - return; - case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: - setDirection((EADirectionKind)newValue); - return; - case HardwaremodelingPackage.HARDWARE_PIN__IMPEDANCE: - setImpedance((Float)newValue); - return; - case HardwaremodelingPackage.HARDWARE_PIN__POWER: - setPower((Float)newValue); - return; + switch (featureID) { + case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: + setBase_Port((Port)newValue); + return; + case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: + setIsGround((Boolean)newValue); + return; + case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: + setDirection((EADirectionKind)newValue); + return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ @Override @@ -260,15 +201,14 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * * @generated */ public Port getBase_Port() { - if(base_Port != null && base_Port.eIsProxy()) { + if (base_Port != null && base_Port.eIsProxy()) { InternalEObject oldBase_Port = (InternalEObject)base_Port; base_Port = (Port)eResolveProxy(oldBase_Port); - if(base_Port != oldBase_Port) { - if(eNotificationRequired()) + if (base_Port != oldBase_Port) { + if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT, oldBase_Port, base_Port)); } } @@ -278,7 +218,6 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * * @generated */ public Port basicGetBase_Port() { @@ -288,49 +227,37 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * * @generated */ public void setBase_Port(Port newBase_Port) { Port oldBase_Port = base_Port; base_Port = newBase_Port; - if(eNotificationRequired()) + if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT, oldBase_Port, base_Port)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ @Override public void eUnset(int featureID) { - switch(featureID) { - case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: - setBase_Port((Port)null); - return; - case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: - setIsGround(IS_GROUND_EDEFAULT); - return; - case HardwaremodelingPackage.HARDWARE_PIN__VOLTAGE: - setVoltage(VOLTAGE_EDEFAULT); - return; - case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: - setDirection(DIRECTION_EDEFAULT); - return; - case HardwaremodelingPackage.HARDWARE_PIN__IMPEDANCE: - setImpedance(IMPEDANCE_EDEFAULT); - return; - case HardwaremodelingPackage.HARDWARE_PIN__POWER: - setPower(POWER_EDEFAULT); - return; + switch (featureID) { + case HardwaremodelingPackage.HARDWARE_PIN__BASE_PORT: + setBase_Port((Port)null); + return; + case HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND: + setIsGround(IS_GROUND_EDEFAULT); + return; + case HardwaremodelingPackage.HARDWARE_PIN__DIRECTION: + setDirection(DIRECTION_EDEFAULT); + return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ public EADirectionKind getDirection() { @@ -340,46 +267,17 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * * @generated */ public void setDirection(EADirectionKind newDirection) { EADirectionKind oldDirection = direction; direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection; - if(eNotificationRequired()) + if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__DIRECTION, oldDirection, direction)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Float getImpedance() { - return impedance; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Float getPower() { - return power; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Float getVoltage() { - return voltage; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ public boolean isIsGround() { @@ -388,73 +286,28 @@ public abstract class HardwarePinImpl extends EAElementImpl implements HardwareP /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void setImpedance(Float newImpedance) { - Float oldImpedance = impedance; - impedance = newImpedance; - if(eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__IMPEDANCE, oldImpedance, impedance)); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * * @generated */ public void setIsGround(boolean newIsGround) { boolean oldIsGround = isGround; isGround = newIsGround; - if(eNotificationRequired()) + if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__IS_GROUND, oldIsGround, isGround)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void setPower(Float newPower) { - Float oldPower = power; - power = newPower; - if(eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__POWER, oldPower, power)); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void setVoltage(Float newVoltage) { - Float oldVoltage = voltage; - voltage = newVoltage; - if(eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, HardwaremodelingPackage.HARDWARE_PIN__VOLTAGE, oldVoltage, voltage)); - } - - /** - * <!-- 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(" (isGround: "); result.append(isGround); - result.append(", voltage: "); - result.append(voltage); result.append(", direction: "); result.append(direction); - result.append(", impedance: "); - result.append(impedance); - result.append(", power: "); - result.append(power); result.append(')'); return result.toString(); } |