/******************************************************************************* | |
* * 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 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.Event; | |
import org.eclipse.uml2.uml.Property; | |
import org.eclipse.uml2.uml.State; | |
import org.eclipse.uml2.uml.Transition; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.DepEvent; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.ThreatsPropagationPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Dep Event</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.DepEventImpl#getPort <em>Port</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.DepEventImpl#getBase_Transition <em>Base Transition</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.DepEventImpl#getWeight <em>Weight</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public abstract class DepEventImpl extends EObjectImpl implements DepEvent { | |
/** | |
* The cached value of the '{@link #getPort() <em>Port</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getPort() | |
* @generated | |
* @ordered | |
*/ | |
protected Property port; | |
/** | |
* 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 DepEventImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ThreatsPropagationPackage.Literals.DEP_EVENT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Property getPort() { | |
if (port != null && port.eIsProxy()) { | |
InternalEObject oldPort = (InternalEObject)port; | |
port = (Property)eResolveProxy(oldPort); | |
if (port != oldPort) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ThreatsPropagationPackage.DEP_EVENT__PORT, oldPort, port)); | |
} | |
} | |
return port; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Property basicGetPort() { | |
return port; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setPort(Property newPort) { | |
Property oldPort = port; | |
port = newPort; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.DEP_EVENT__PORT, oldPort, port)); | |
} | |
/** | |
* <!-- 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.DEP_EVENT__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.DEP_EVENT__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.DEP_EVENT__WEIGHT, oldWeight, weight)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ThreatsPropagationPackage.DEP_EVENT__PORT: | |
if (resolve) return getPort(); | |
return basicGetPort(); | |
case ThreatsPropagationPackage.DEP_EVENT__BASE_TRANSITION: | |
if (resolve) return getBase_Transition(); | |
return basicGetBase_Transition(); | |
case ThreatsPropagationPackage.DEP_EVENT__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.DEP_EVENT__PORT: | |
setPort((Property)newValue); | |
return; | |
case ThreatsPropagationPackage.DEP_EVENT__BASE_TRANSITION: | |
setBase_Transition((Transition)newValue); | |
return; | |
case ThreatsPropagationPackage.DEP_EVENT__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.DEP_EVENT__PORT: | |
setPort((Property)null); | |
return; | |
case ThreatsPropagationPackage.DEP_EVENT__BASE_TRANSITION: | |
setBase_Transition((Transition)null); | |
return; | |
case ThreatsPropagationPackage.DEP_EVENT__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.DEP_EVENT__PORT: | |
return port != null; | |
case ThreatsPropagationPackage.DEP_EVENT__BASE_TRANSITION: | |
return base_Transition != null; | |
case ThreatsPropagationPackage.DEP_EVENT__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(" (weight: "); | |
result.append(weight); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //DepEventImpl |