blob: ed1b4275f1cc81fad4f15cf1c0924515fed1267a [file] [log] [blame]
/**
* Copyright (c) 2016 Willink Transformations, Univesity of York and others.
* 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
*
* Contributors:
* Adolfo Sanchez-Barbudo Herrera - initial API and implementation
*/
package astm.impl;
import astm.AstmPackage;
import astm.Type;
import java.lang.Boolean;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link astm.impl.TypeImpl#isIsConst <em>Is Const</em>}</li>
* <li>{@link astm.impl.TypeImpl#isIsVolatile <em>Is Volatile</em>}</li>
* </ul>
*
* @generated
*/
public abstract class TypeImpl extends GASTMSyntaxObjectImpl implements Type {
/**
* The default value of the '{@link #isIsConst() <em>Is Const</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsConst()
* @generated
* @ordered
*/
protected static final boolean IS_CONST_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsConst() <em>Is Const</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsConst()
* @generated
* @ordered
*/
protected boolean isConst = IS_CONST_EDEFAULT;
/**
* The default value of the '{@link #isIsVolatile() <em>Is Volatile</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsVolatile()
* @generated
* @ordered
*/
protected static final boolean IS_VOLATILE_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsVolatile() <em>Is Volatile</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsVolatile()
* @generated
* @ordered
*/
protected boolean isVolatile = IS_VOLATILE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AstmPackage.Literals.TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsConst() {
return isConst;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsConst(boolean newIsConst) {
boolean oldIsConst = isConst;
isConst = newIsConst;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstmPackage.TYPE__IS_CONST, oldIsConst, isConst));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsVolatile() {
return isVolatile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsVolatile(boolean newIsVolatile) {
boolean oldIsVolatile = isVolatile;
isVolatile = newIsVolatile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstmPackage.TYPE__IS_VOLATILE, oldIsVolatile, isVolatile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AstmPackage.TYPE__IS_CONST:
return isIsConst();
case AstmPackage.TYPE__IS_VOLATILE:
return isIsVolatile();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AstmPackage.TYPE__IS_CONST:
setIsConst((Boolean)newValue);
return;
case AstmPackage.TYPE__IS_VOLATILE:
setIsVolatile((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AstmPackage.TYPE__IS_CONST:
setIsConst(IS_CONST_EDEFAULT);
return;
case AstmPackage.TYPE__IS_VOLATILE:
setIsVolatile(IS_VOLATILE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AstmPackage.TYPE__IS_CONST:
return isConst != IS_CONST_EDEFAULT;
case AstmPackage.TYPE__IS_VOLATILE:
return isVolatile != IS_VOLATILE_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(" (isConst: ");
result.append(isConst);
result.append(", isVolatile: ");
result.append(isVolatile);
result.append(')');
return result.toString();
}
} //TypeImpl