blob: cf8813ec1587b04e96ca4839643e1064cc064e26 [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.FailurePropagation.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.Comment;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.ACIDAvoidable;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.FailurePropagationPackage;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.FailurePropagationDataTypes.A_avoidable;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.FailurePropagationDataTypes.C_avoidable;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.FailurePropagationDataTypes.D_avoidable;
import org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.FailurePropagationDataTypes.I_avoidable;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ACID Avoidable</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.impl.ACIDAvoidableImpl#getA <em>A</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.impl.ACIDAvoidableImpl#getC <em>C</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.impl.ACIDAvoidableImpl#getBase_Comment <em>Base Comment</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.impl.ACIDAvoidableImpl#getI <em>I</em>}</li>
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.FailurePropagation.impl.ACIDAvoidableImpl#getD <em>D</em>}</li>
* </ul>
*
* @generated
*/
public class ACIDAvoidableImpl extends EObjectImpl implements ACIDAvoidable {
/**
* The default value of the '{@link #getA() <em>A</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getA()
* @generated
* @ordered
*/
protected static final A_avoidable A_EDEFAULT = A_avoidable.UNSPECIFIED;
/**
* The cached value of the '{@link #getA() <em>A</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getA()
* @generated
* @ordered
*/
protected A_avoidable a = A_EDEFAULT;
/**
* The default value of the '{@link #getC() <em>C</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getC()
* @generated
* @ordered
*/
protected static final C_avoidable C_EDEFAULT = C_avoidable.UNSPECIFIED;
/**
* The cached value of the '{@link #getC() <em>C</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getC()
* @generated
* @ordered
*/
protected C_avoidable c = C_EDEFAULT;
/**
* The cached value of the '{@link #getBase_Comment() <em>Base Comment</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Comment()
* @generated
* @ordered
*/
protected Comment base_Comment;
/**
* The default value of the '{@link #getI() <em>I</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getI()
* @generated
* @ordered
*/
protected static final I_avoidable I_EDEFAULT = I_avoidable.UNSPECIFIED;
/**
* The cached value of the '{@link #getI() <em>I</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getI()
* @generated
* @ordered
*/
protected I_avoidable i = I_EDEFAULT;
/**
* The default value of the '{@link #getD() <em>D</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getD()
* @generated
* @ordered
*/
protected static final D_avoidable D_EDEFAULT = D_avoidable.UNSPECIFIED;
/**
* The cached value of the '{@link #getD() <em>D</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getD()
* @generated
* @ordered
*/
protected D_avoidable d = D_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ACIDAvoidableImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FailurePropagationPackage.Literals.ACID_AVOIDABLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public A_avoidable getA() {
return a;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setA(A_avoidable newA) {
A_avoidable oldA = a;
a = newA == null ? A_EDEFAULT : newA;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FailurePropagationPackage.ACID_AVOIDABLE__A, oldA, a));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public C_avoidable getC() {
return c;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setC(C_avoidable newC) {
C_avoidable oldC = c;
c = newC == null ? C_EDEFAULT : newC;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FailurePropagationPackage.ACID_AVOIDABLE__C, oldC, c));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Comment getBase_Comment() {
if (base_Comment != null && base_Comment.eIsProxy()) {
InternalEObject oldBase_Comment = (InternalEObject)base_Comment;
base_Comment = (Comment)eResolveProxy(oldBase_Comment);
if (base_Comment != oldBase_Comment) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT, oldBase_Comment, base_Comment));
}
}
return base_Comment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Comment basicGetBase_Comment() {
return base_Comment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Comment(Comment newBase_Comment) {
Comment oldBase_Comment = base_Comment;
base_Comment = newBase_Comment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT, oldBase_Comment, base_Comment));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public I_avoidable getI() {
return i;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setI(I_avoidable newI) {
I_avoidable oldI = i;
i = newI == null ? I_EDEFAULT : newI;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FailurePropagationPackage.ACID_AVOIDABLE__I, oldI, i));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public D_avoidable getD() {
return d;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setD(D_avoidable newD) {
D_avoidable oldD = d;
d = newD == null ? D_EDEFAULT : newD;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FailurePropagationPackage.ACID_AVOIDABLE__D, oldD, d));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FailurePropagationPackage.ACID_AVOIDABLE__A:
return getA();
case FailurePropagationPackage.ACID_AVOIDABLE__C:
return getC();
case FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT:
if (resolve) return getBase_Comment();
return basicGetBase_Comment();
case FailurePropagationPackage.ACID_AVOIDABLE__I:
return getI();
case FailurePropagationPackage.ACID_AVOIDABLE__D:
return getD();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FailurePropagationPackage.ACID_AVOIDABLE__A:
setA((A_avoidable)newValue);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__C:
setC((C_avoidable)newValue);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT:
setBase_Comment((Comment)newValue);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__I:
setI((I_avoidable)newValue);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__D:
setD((D_avoidable)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FailurePropagationPackage.ACID_AVOIDABLE__A:
setA(A_EDEFAULT);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__C:
setC(C_EDEFAULT);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT:
setBase_Comment((Comment)null);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__I:
setI(I_EDEFAULT);
return;
case FailurePropagationPackage.ACID_AVOIDABLE__D:
setD(D_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FailurePropagationPackage.ACID_AVOIDABLE__A:
return a != A_EDEFAULT;
case FailurePropagationPackage.ACID_AVOIDABLE__C:
return c != C_EDEFAULT;
case FailurePropagationPackage.ACID_AVOIDABLE__BASE_COMMENT:
return base_Comment != null;
case FailurePropagationPackage.ACID_AVOIDABLE__I:
return i != I_EDEFAULT;
case FailurePropagationPackage.ACID_AVOIDABLE__D:
return d != D_EDEFAULT;
}
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(" (a: ");
result.append(a);
result.append(", c: ");
result.append(c);
result.append(", i: ");
result.append(i);
result.append(", d: ");
result.append(d);
result.append(')');
return result.toString();
}
} //ACIDAvoidableImpl