/**
*/
package rba.core.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
import rba.core.AbstractProperty;
import rba.core.ExpressionType;
import rba.core.RBACorePackage;
import rba.core.Scene;
/**
* An implementation of the model object 'Scene'.
*
* The following features are implemented:
*
*
* - {@link rba.core.impl.SceneImpl#isGlobal Global}
* - {@link rba.core.impl.SceneImpl#getProperties Properties}
*
*
* @generated
*/
public class SceneImpl extends AbstractSceneImpl implements Scene {
/**
* The default value of the '{@link #isGlobal() Global}' attribute.
*
* @see #isGlobal()
* @generated
* @ordered
*/
protected static final boolean GLOBAL_EDEFAULT = false;
/**
* The cached value of the '{@link #isGlobal() Global}' attribute.
*
* @see #isGlobal()
* @generated
* @ordered
*/
protected boolean global = GLOBAL_EDEFAULT;
/**
* The cached value of the '{@link #getProperties() Properties}' containment reference list.
*
* @see #getProperties()
* @generated
* @ordered
*/
protected EList properties;
/**
*
* @generated
*/
protected SceneImpl() {
super();
}
/**
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RBACorePackage.Literals.SCENE;
}
/**
*
* @generated
*/
public boolean isGlobal() {
return global;
}
/**
*
* @generated
*/
public void setGlobal(boolean newGlobal) {
boolean oldGlobal = global;
global = newGlobal;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.SCENE__GLOBAL, oldGlobal, global));
}
/**
*
* @generated
*/
public EList getProperties() {
if (properties == null) {
properties = new EObjectContainmentWithInverseEList(AbstractProperty.class, this,
RBACorePackage.SCENE__PROPERTIES, RBACorePackage.ABSTRACT_PROPERTY__OWNER);
}
return properties;
}
/**
*
* @generated
*/
public ExpressionType getExpressionType() {
return ExpressionType.SCENE;
}
/**
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RBACorePackage.SCENE__PROPERTIES:
return ((InternalEList) (InternalEList>) getProperties()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RBACorePackage.SCENE__PROPERTIES:
return ((InternalEList>) getProperties()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RBACorePackage.SCENE__GLOBAL:
return isGlobal();
case RBACorePackage.SCENE__PROPERTIES:
return getProperties();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RBACorePackage.SCENE__GLOBAL:
setGlobal((Boolean) newValue);
return;
case RBACorePackage.SCENE__PROPERTIES:
getProperties().clear();
getProperties().addAll((Collection extends AbstractProperty>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RBACorePackage.SCENE__GLOBAL:
setGlobal(GLOBAL_EDEFAULT);
return;
case RBACorePackage.SCENE__PROPERTIES:
getProperties().clear();
return;
}
super.eUnset(featureID);
}
/**
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RBACorePackage.SCENE__GLOBAL:
return global != GLOBAL_EDEFAULT;
case RBACorePackage.SCENE__PROPERTIES:
return properties != null && !properties.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
* @generated
*/
@Override
public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException {
switch (operationID) {
case RBACorePackage.SCENE___GET_EXPRESSION_TYPE:
return getExpressionType();
}
return super.eInvoke(operationID, arguments);
}
/**
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (global: ");
result.append(global);
result.append(')');
return result.toString();
}
} // SceneImpl