/**
* Copyright (c) 2013 itemis AG 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:
* itemis AG - initial API and implementation
*
*/
package org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.rmf.tests.serialization.env.emf.myreqif.ATTRIBUTEVALUEBOOLEAN;
import org.eclipse.rmf.tests.serialization.env.emf.myreqif.DEFINITIONType6;
import org.eclipse.rmf.tests.serialization.env.emf.myreqif.MyreqifPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ATTRIBUTEVALUEBOOLEAN</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUEBOOLEANImpl#getDEFINITION <em>DEFINITION</em>}</li>
* <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUEBOOLEANImpl#isTHEVALUE <em>THEVALUE</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ATTRIBUTEVALUEBOOLEANImpl extends EObjectImpl implements ATTRIBUTEVALUEBOOLEAN {
/**
* The cached value of the '{@link #getDEFINITION() <em>DEFINITION</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDEFINITION()
* @generated
* @ordered
*/
protected DEFINITIONType6 dEFINITION;
/**
* The default value of the '{@link #isTHEVALUE() <em>THEVALUE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isTHEVALUE()
* @generated
* @ordered
*/
protected static final boolean THEVALUE_EDEFAULT = false;
/**
* The cached value of the '{@link #isTHEVALUE() <em>THEVALUE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isTHEVALUE()
* @generated
* @ordered
*/
protected boolean tHEVALUE = THEVALUE_EDEFAULT;
/**
* This is true if the THEVALUE attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean tHEVALUEESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ATTRIBUTEVALUEBOOLEANImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MyreqifPackage.Literals.ATTRIBUTEVALUEBOOLEAN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DEFINITIONType6 getDEFINITION() {
return dEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDEFINITION(DEFINITIONType6 newDEFINITION, NotificationChain msgs) {
DEFINITIONType6 oldDEFINITION = dEFINITION;
dEFINITION = newDEFINITION;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION, oldDEFINITION, newDEFINITION);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDEFINITION(DEFINITIONType6 newDEFINITION) {
if (newDEFINITION != dEFINITION) {
NotificationChain msgs = null;
if (dEFINITION != null)
msgs = ((InternalEObject)dEFINITION).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION, null, msgs);
if (newDEFINITION != null)
msgs = ((InternalEObject)newDEFINITION).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION, null, msgs);
msgs = basicSetDEFINITION(newDEFINITION, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION, newDEFINITION, newDEFINITION));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isTHEVALUE() {
return tHEVALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTHEVALUE(boolean newTHEVALUE) {
boolean oldTHEVALUE = tHEVALUE;
tHEVALUE = newTHEVALUE;
boolean oldTHEVALUEESet = tHEVALUEESet;
tHEVALUEESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE, oldTHEVALUE, tHEVALUE, !oldTHEVALUEESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetTHEVALUE() {
boolean oldTHEVALUE = tHEVALUE;
boolean oldTHEVALUEESet = tHEVALUEESet;
tHEVALUE = THEVALUE_EDEFAULT;
tHEVALUEESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE, oldTHEVALUE, THEVALUE_EDEFAULT, oldTHEVALUEESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetTHEVALUE() {
return tHEVALUEESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION:
return basicSetDEFINITION(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION:
return getDEFINITION();
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE:
return isTHEVALUE();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION:
setDEFINITION((DEFINITIONType6)newValue);
return;
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE:
setTHEVALUE((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION:
setDEFINITION((DEFINITIONType6)null);
return;
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE:
unsetTHEVALUE();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__DEFINITION:
return dEFINITION != null;
case MyreqifPackage.ATTRIBUTEVALUEBOOLEAN__THEVALUE:
return isSetTHEVALUE();
}
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(" (tHEVALUE: ");
if (tHEVALUEESet) result.append(tHEVALUE); else result.append("<unset>");
result.append(')');
return result.toString();
}
} //ATTRIBUTEVALUEBOOLEANImpl