blob: 4dca17bba6435312992d53a81e2563b69ff2bf1c [file] [log] [blame]
/*****************************************************************************
* 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 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.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.StuckAt;
import org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.ThreatsPropagationPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Stuck At</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.StuckAtImpl#getProperty <em>Property</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.StuckAtImpl#getValue <em>Value</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.ThreatsPropagation.impl.StuckAtImpl#getBase_State <em>Base State</em>}</li>
* </ul>
*
* @generated
*/
public class StuckAtImpl extends EObjectImpl implements StuckAt {
/**
* 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 #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* 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;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StuckAtImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ThreatsPropagationPackage.Literals.STUCK_AT;
}
/**
* <!-- 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.STUCK_AT__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.STUCK_AT__PROPERTY, oldProperty, property));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(String newValue) {
String oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ThreatsPropagationPackage.STUCK_AT__VALUE, oldValue, value));
}
/**
* <!-- 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.STUCK_AT__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.STUCK_AT__BASE_STATE, oldBase_State, base_State));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ThreatsPropagationPackage.STUCK_AT__PROPERTY:
if (resolve) return getProperty();
return basicGetProperty();
case ThreatsPropagationPackage.STUCK_AT__VALUE:
return getValue();
case ThreatsPropagationPackage.STUCK_AT__BASE_STATE:
if (resolve) return getBase_State();
return basicGetBase_State();
}
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.STUCK_AT__PROPERTY:
setProperty((Property)newValue);
return;
case ThreatsPropagationPackage.STUCK_AT__VALUE:
setValue((String)newValue);
return;
case ThreatsPropagationPackage.STUCK_AT__BASE_STATE:
setBase_State((State)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ThreatsPropagationPackage.STUCK_AT__PROPERTY:
setProperty((Property)null);
return;
case ThreatsPropagationPackage.STUCK_AT__VALUE:
setValue(VALUE_EDEFAULT);
return;
case ThreatsPropagationPackage.STUCK_AT__BASE_STATE:
setBase_State((State)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ThreatsPropagationPackage.STUCK_AT__PROPERTY:
return property != null;
case ThreatsPropagationPackage.STUCK_AT__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case ThreatsPropagationPackage.STUCK_AT__BASE_STATE:
return base_State != null;
}
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(" (value: ");
result.append(value);
result.append(')');
return result.toString();
}
} //StuckAtImpl