blob: c92c725fdea7bc918e7cac90fcb0900cab3e3dfc [file] [log] [blame]
/*******************************************************************************
* * Copyright (c) 2015 University of Padova, Intecs
* *
* *
* * 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
* *
*******************************************************************************/
/**
*/
package org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl;
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.emf.ecore.impl.EObjectImpl;
import org.eclipse.uml2.uml.Transition;
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.InternalPropagation;
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.ThreatsPropagationPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Internal Propagation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalPropagationImpl#getBase_Transition <em>Base Transition</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalPropagationImpl#getExternalFaults <em>External Faults</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalPropagationImpl#getDelay <em>Delay</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalPropagationImpl#getWeight <em>Weight</em>}</li>
* </ul>
*
* @generated
*/
public class InternalPropagationImpl extends EObjectImpl implements InternalPropagation {
/**
* The cached value of the '{@link #getBase_Transition() <em>Base Transition</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Transition()
* @generated
* @ordered
*/
protected Transition base_Transition;
/**
* The default value of the '{@link #getExternalFaults() <em>External Faults</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExternalFaults()
* @generated
* @ordered
*/
protected static final String EXTERNAL_FAULTS_EDEFAULT = null;
/**
* The cached value of the '{@link #getExternalFaults() <em>External Faults</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExternalFaults()
* @generated
* @ordered
*/
protected String externalFaults = EXTERNAL_FAULTS_EDEFAULT;
/**
* The default value of the '{@link #getDelay() <em>Delay</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDelay()
* @generated
* @ordered
*/
protected static final String DELAY_EDEFAULT = null;
/**
* The cached value of the '{@link #getDelay() <em>Delay</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDelay()
* @generated
* @ordered
*/
protected String delay = DELAY_EDEFAULT;
/**
* The default value of the '{@link #getWeight() <em>Weight</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWeight()
* @generated
* @ordered
*/
protected static final String WEIGHT_EDEFAULT = null;
/**
* The cached value of the '{@link #getWeight() <em>Weight</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWeight()
* @generated
* @ordered
*/
protected String weight = WEIGHT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InternalPropagationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ThreatsPropagationPackage.Literals.INTERNAL_PROPAGATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Transition getBase_Transition() {
if (base_Transition != null && base_Transition.eIsProxy()) {
InternalEObject oldBase_Transition = (InternalEObject)base_Transition;
base_Transition = (Transition)eResolveProxy(oldBase_Transition);
if (base_Transition != oldBase_Transition) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION, oldBase_Transition, base_Transition));
}
}
return base_Transition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Transition basicGetBase_Transition() {
return base_Transition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Transition(Transition newBase_Transition) {
Transition oldBase_Transition = base_Transition;
base_Transition = newBase_Transition;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION, oldBase_Transition, base_Transition));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getExternalFaults() {
return externalFaults;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExternalFaults(String newExternalFaults) {
String oldExternalFaults = externalFaults;
externalFaults = newExternalFaults;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.INTERNAL_PROPAGATION__EXTERNAL_FAULTS, oldExternalFaults, externalFaults));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDelay() {
return delay;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDelay(String newDelay) {
String oldDelay = delay;
delay = newDelay;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.INTERNAL_PROPAGATION__DELAY, oldDelay, delay));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getWeight() {
return weight;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setWeight(String newWeight) {
String oldWeight = weight;
weight = newWeight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.INTERNAL_PROPAGATION__WEIGHT, oldWeight, weight));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION:
if (resolve) return getBase_Transition();
return basicGetBase_Transition();
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__EXTERNAL_FAULTS:
return getExternalFaults();
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__DELAY:
return getDelay();
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__WEIGHT:
return getWeight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION:
setBase_Transition((Transition)newValue);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__EXTERNAL_FAULTS:
setExternalFaults((String)newValue);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__DELAY:
setDelay((String)newValue);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__WEIGHT:
setWeight((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION:
setBase_Transition((Transition)null);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__EXTERNAL_FAULTS:
setExternalFaults(EXTERNAL_FAULTS_EDEFAULT);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__DELAY:
setDelay(DELAY_EDEFAULT);
return;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__WEIGHT:
setWeight(WEIGHT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__BASE_TRANSITION:
return base_Transition != null;
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__EXTERNAL_FAULTS:
return EXTERNAL_FAULTS_EDEFAULT == null ? externalFaults != null : !EXTERNAL_FAULTS_EDEFAULT.equals(externalFaults);
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__DELAY:
return DELAY_EDEFAULT == null ? delay != null : !DELAY_EDEFAULT.equals(delay);
case ThreatsPropagationPackage.INTERNAL_PROPAGATION__WEIGHT:
return WEIGHT_EDEFAULT == null ? weight != null : !WEIGHT_EDEFAULT.equals(weight);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (externalFaults: ");
result.append(externalFaults);
result.append(", delay: ");
result.append(delay);
result.append(", weight: ");
result.append(weight);
result.append(')');
return result.toString();
}
} //InternalPropagationImpl