/**
* 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.ATTRIBUTEVALUESTRING;
import org.eclipse.rmf.tests.serialization.env.emf.myreqif.DEFINITIONType2;
import org.eclipse.rmf.tests.serialization.env.emf.myreqif.MyreqifPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ATTRIBUTEVALUESTRING</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUESTRINGImpl#getDEFINITION <em>DEFINITION</em>}</li>
* <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.ATTRIBUTEVALUESTRINGImpl#getTHEVALUE <em>THEVALUE</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ATTRIBUTEVALUESTRINGImpl extends EObjectImpl implements ATTRIBUTEVALUESTRING {
/**
* The cached value of the '{@link #getDEFINITION() <em>DEFINITION</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDEFINITION()
* @generated
* @ordered
*/
protected DEFINITIONType2 dEFINITION;
/**
* The default value of the '{@link #getTHEVALUE() <em>THEVALUE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTHEVALUE()
* @generated
* @ordered
*/
protected static final String THEVALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getTHEVALUE() <em>THEVALUE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTHEVALUE()
* @generated
* @ordered
*/
protected String tHEVALUE = THEVALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ATTRIBUTEVALUESTRINGImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MyreqifPackage.Literals.ATTRIBUTEVALUESTRING;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DEFINITIONType2 getDEFINITION() {
return dEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDEFINITION(DEFINITIONType2 newDEFINITION, NotificationChain msgs) {
DEFINITIONType2 oldDEFINITION = dEFINITION;
dEFINITION = newDEFINITION;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION, oldDEFINITION, newDEFINITION);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDEFINITION(DEFINITIONType2 newDEFINITION) {
if (newDEFINITION != dEFINITION) {
NotificationChain msgs = null;
if (dEFINITION != null)
msgs = ((InternalEObject)dEFINITION).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION, null, msgs);
if (newDEFINITION != null)
msgs = ((InternalEObject)newDEFINITION).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION, null, msgs);
msgs = basicSetDEFINITION(newDEFINITION, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION, newDEFINITION, newDEFINITION));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getTHEVALUE() {
return tHEVALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTHEVALUE(String newTHEVALUE) {
String oldTHEVALUE = tHEVALUE;
tHEVALUE = newTHEVALUE;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MyreqifPackage.ATTRIBUTEVALUESTRING__THEVALUE, oldTHEVALUE, tHEVALUE));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUESTRING__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.ATTRIBUTEVALUESTRING__DEFINITION:
return getDEFINITION();
case MyreqifPackage.ATTRIBUTEVALUESTRING__THEVALUE:
return getTHEVALUE();
}
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.ATTRIBUTEVALUESTRING__DEFINITION:
setDEFINITION((DEFINITIONType2)newValue);
return;
case MyreqifPackage.ATTRIBUTEVALUESTRING__THEVALUE:
setTHEVALUE((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION:
setDEFINITION((DEFINITIONType2)null);
return;
case MyreqifPackage.ATTRIBUTEVALUESTRING__THEVALUE:
setTHEVALUE(THEVALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MyreqifPackage.ATTRIBUTEVALUESTRING__DEFINITION:
return dEFINITION != null;
case MyreqifPackage.ATTRIBUTEVALUESTRING__THEVALUE:
return THEVALUE_EDEFAULT == null ? tHEVALUE != null : !THEVALUE_EDEFAULT.equals(tHEVALUE);
}
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: ");
result.append(tHEVALUE);
result.append(')');
return result.toString();
}
} //ATTRIBUTEVALUESTRINGImpl