/***************************************************************************** | |
* Copyright (c) 2011, 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 v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.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.Property; | |
import org.eclipse.uml2.uml.State; | |
import org.eclipse.uml2.uml.Transition; | |
import org.polarsys.chess.chessmlprofile.Dependability.DependableComponent.VulnerabilityType; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.InternalFault; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.ThreatsPropagationPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Internal Fault</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalFaultImpl#getOccurrence <em>Occurrence</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalFaultImpl#getBase_Transition <em>Base Transition</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.InternalFaultImpl#getWeight <em>Weight</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class InternalFaultImpl extends EObjectImpl implements InternalFault { | |
/** | |
* The default value of the '{@link #getOccurrence() <em>Occurrence</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getOccurrence() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String OCCURRENCE_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getOccurrence() <em>Occurrence</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getOccurrence() | |
* @generated | |
* @ordered | |
*/ | |
protected String occurrence = OCCURRENCE_EDEFAULT; | |
/** | |
* 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 #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 InternalFaultImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ThreatsPropagationPackage.Literals.INTERNAL_FAULT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getOccurrence() { | |
return occurrence; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setOccurrence(String newOccurrence) { | |
String oldOccurrence = occurrence; | |
occurrence = newOccurrence; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.INTERNAL_FAULT__OCCURRENCE, oldOccurrence, occurrence)); | |
} | |
/** | |
* <!-- 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_FAULT__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_FAULT__BASE_TRANSITION, oldBase_Transition, base_Transition)); | |
} | |
/** | |
* <!-- 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_FAULT__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_FAULT__OCCURRENCE: | |
return getOccurrence(); | |
case ThreatsPropagationPackage.INTERNAL_FAULT__BASE_TRANSITION: | |
if (resolve) return getBase_Transition(); | |
return basicGetBase_Transition(); | |
case ThreatsPropagationPackage.INTERNAL_FAULT__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_FAULT__OCCURRENCE: | |
setOccurrence((String)newValue); | |
return; | |
case ThreatsPropagationPackage.INTERNAL_FAULT__BASE_TRANSITION: | |
setBase_Transition((Transition)newValue); | |
return; | |
case ThreatsPropagationPackage.INTERNAL_FAULT__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_FAULT__OCCURRENCE: | |
setOccurrence(OCCURRENCE_EDEFAULT); | |
return; | |
case ThreatsPropagationPackage.INTERNAL_FAULT__BASE_TRANSITION: | |
setBase_Transition((Transition)null); | |
return; | |
case ThreatsPropagationPackage.INTERNAL_FAULT__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_FAULT__OCCURRENCE: | |
return OCCURRENCE_EDEFAULT == null ? occurrence != null : !OCCURRENCE_EDEFAULT.equals(occurrence); | |
case ThreatsPropagationPackage.INTERNAL_FAULT__BASE_TRANSITION: | |
return base_Transition != null; | |
case ThreatsPropagationPackage.INTERNAL_FAULT__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(" (occurrence: "); | |
result.append(occurrence); | |
result.append(", weight: "); | |
result.append(weight); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //InternalFaultImpl |