/***************************************************************************** | |
* Copyright (c) 2011 - 2014 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.Property; | |
import org.eclipse.uml2.uml.State; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.RampDown; | |
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.ThreatsPropagationPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Ramp Down</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.RampDownImpl#getBase_State <em>Base State</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.RampDownImpl#getProperty <em>Property</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.RampDownImpl#getDecr <em>Decr</em>}</li> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.RampDownImpl#getEndValue <em>End Value</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class RampDownImpl extends EObjectImpl implements RampDown { | |
/** | |
* The cached value of the '{@link #getBase_State() <em>Base State</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getBase_State() | |
* @generated | |
* @ordered | |
*/ | |
protected State base_State; | |
/** | |
* The cached value of the '{@link #getProperty() <em>Property</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProperty() | |
* @generated | |
* @ordered | |
*/ | |
protected Property property; | |
/** | |
* The default value of the '{@link #getDecr() <em>Decr</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDecr() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String DECR_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getDecr() <em>Decr</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDecr() | |
* @generated | |
* @ordered | |
*/ | |
protected String decr = DECR_EDEFAULT; | |
/** | |
* The default value of the '{@link #getEndValue() <em>End Value</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEndValue() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String END_VALUE_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getEndValue() <em>End Value</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEndValue() | |
* @generated | |
* @ordered | |
*/ | |
protected String endValue = END_VALUE_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected RampDownImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ThreatsPropagationPackage.Literals.RAMP_DOWN; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public State getBase_State() { | |
if (base_State != null && base_State.eIsProxy()) { | |
InternalEObject oldBase_State = (InternalEObject)base_State; | |
base_State = (State)eResolveProxy(oldBase_State); | |
if (base_State != oldBase_State) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ThreatsPropagationPackage.RAMP_DOWN__BASE_STATE, oldBase_State, base_State)); | |
} | |
} | |
return base_State; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public State basicGetBase_State() { | |
return base_State; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setBase_State(State newBase_State) { | |
State oldBase_State = base_State; | |
base_State = newBase_State; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.RAMP_DOWN__BASE_STATE, oldBase_State, base_State)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Property getProperty() { | |
if (property != null && property.eIsProxy()) { | |
InternalEObject oldProperty = (InternalEObject)property; | |
property = (Property)eResolveProxy(oldProperty); | |
if (property != oldProperty) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ThreatsPropagationPackage.RAMP_DOWN__PROPERTY, oldProperty, property)); | |
} | |
} | |
return property; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Property basicGetProperty() { | |
return property; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setProperty(Property newProperty) { | |
Property oldProperty = property; | |
property = newProperty; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.RAMP_DOWN__PROPERTY, oldProperty, property)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getDecr() { | |
return decr; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setDecr(String newDecr) { | |
String oldDecr = decr; | |
decr = newDecr; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.RAMP_DOWN__DECR, oldDecr, decr)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getEndValue() { | |
return endValue; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setEndValue(String newEndValue) { | |
String oldEndValue = endValue; | |
endValue = newEndValue; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.RAMP_DOWN__END_VALUE, oldEndValue, endValue)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ThreatsPropagationPackage.RAMP_DOWN__BASE_STATE: | |
if (resolve) return getBase_State(); | |
return basicGetBase_State(); | |
case ThreatsPropagationPackage.RAMP_DOWN__PROPERTY: | |
if (resolve) return getProperty(); | |
return basicGetProperty(); | |
case ThreatsPropagationPackage.RAMP_DOWN__DECR: | |
return getDecr(); | |
case ThreatsPropagationPackage.RAMP_DOWN__END_VALUE: | |
return getEndValue(); | |
} | |
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.RAMP_DOWN__BASE_STATE: | |
setBase_State((State)newValue); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__PROPERTY: | |
setProperty((Property)newValue); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__DECR: | |
setDecr((String)newValue); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__END_VALUE: | |
setEndValue((String)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ThreatsPropagationPackage.RAMP_DOWN__BASE_STATE: | |
setBase_State((State)null); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__PROPERTY: | |
setProperty((Property)null); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__DECR: | |
setDecr(DECR_EDEFAULT); | |
return; | |
case ThreatsPropagationPackage.RAMP_DOWN__END_VALUE: | |
setEndValue(END_VALUE_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ThreatsPropagationPackage.RAMP_DOWN__BASE_STATE: | |
return base_State != null; | |
case ThreatsPropagationPackage.RAMP_DOWN__PROPERTY: | |
return property != null; | |
case ThreatsPropagationPackage.RAMP_DOWN__DECR: | |
return DECR_EDEFAULT == null ? decr != null : !DECR_EDEFAULT.equals(decr); | |
case ThreatsPropagationPackage.RAMP_DOWN__END_VALUE: | |
return END_VALUE_EDEFAULT == null ? endValue != null : !END_VALUE_EDEFAULT.equals(endValue); | |
} | |
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(" (decr: "); | |
result.append(decr); | |
result.append(", endValue: "); | |
result.append(endValue); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //RampDownImpl |