/**
* <copyright>
* </copyright>
*
* $Id$
*/
package no.hal.scxml.scxmlxt.impl;
import no.hal.scxml.scxmlxt.ScxmlxtPackage;
import no.hal.scxml.scxmlxt.Typed;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Typed</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link no.hal.scxml.scxmlxt.impl.TypedImpl#getEType <em>EType</em>}</li>
* <li>{@link no.hal.scxml.scxmlxt.impl.TypedImpl#isMany <em>Many</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TypedImpl extends EObjectImpl implements Typed {
/**
* The cached value of the '{@link #getEType() <em>EType</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEType()
* @generated
* @ordered
*/
protected EClassifier eType;
/**
* The default value of the '{@link #isMany() <em>Many</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMany()
* @generated
* @ordered
*/
protected static final boolean MANY_EDEFAULT = false;
/**
* The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMany()
* @generated
* @ordered
*/
protected boolean many = MANY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypedImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ScxmlxtPackage.Literals.TYPED;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClassifier getEType() {
if (eType != null && eType.eIsProxy()) {
InternalEObject oldEType = (InternalEObject)eType;
eType = (EClassifier)eResolveProxy(oldEType);
if (eType != oldEType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScxmlxtPackage.TYPED__ETYPE, oldEType, eType));
}
}
return eType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClassifier basicGetEType() {
return eType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEType(EClassifier newEType) {
EClassifier oldEType = eType;
eType = newEType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.TYPED__ETYPE, oldEType, eType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isMany() {
return many;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMany(boolean newMany) {
boolean oldMany = many;
many = newMany;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.TYPED__MANY, oldMany, many));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ScxmlxtPackage.TYPED__ETYPE:
if (resolve) return getEType();
return basicGetEType();
case ScxmlxtPackage.TYPED__MANY:
return isMany();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ScxmlxtPackage.TYPED__ETYPE:
setEType((EClassifier)newValue);
return;
case ScxmlxtPackage.TYPED__MANY:
setMany((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ScxmlxtPackage.TYPED__ETYPE:
setEType((EClassifier)null);
return;
case ScxmlxtPackage.TYPED__MANY:
setMany(MANY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ScxmlxtPackage.TYPED__ETYPE:
return eType != null;
case ScxmlxtPackage.TYPED__MANY:
return many != MANY_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(" (many: ");
result.append(many);
result.append(')');
return result.toString();
}
} //TypedImpl