/**
* <copyright>
* </copyright>
*
* $Id$
*/
package SAG.impl;
import SAG.Actor;
import SAG.Goal;
import SAG.SAGPackage;
import SAG.SAGmodel;
import java.util.Collection;
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.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>SA Gmodel</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link SAG.impl.SAGmodelImpl#getGoals <em>Goals</em>}</li>
* <li>{@link SAG.impl.SAGmodelImpl#getActors <em>Actors</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SAGmodelImpl extends EObjectImpl implements SAGmodel {
/**
* The cached value of the '{@link #getGoals() <em>Goals</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGoals()
* @generated
* @ordered
*/
protected EList<Goal> goals;
/**
* The cached value of the '{@link #getActors() <em>Actors</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActors()
* @generated
* @ordered
*/
protected EList<Actor> actors;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SAGmodelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SAGPackage.Literals.SA_GMODEL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Goal> getGoals() {
if (goals == null) {
goals = new EObjectContainmentEList<Goal>(Goal.class, this, SAGPackage.SA_GMODEL__GOALS);
}
return goals;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Actor> getActors() {
if (actors == null) {
actors = new EObjectContainmentEList<Actor>(Actor.class, this, SAGPackage.SA_GMODEL__ACTORS);
}
return actors;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SAGPackage.SA_GMODEL__GOALS:
return ((InternalEList<?>)getGoals()).basicRemove(otherEnd, msgs);
case SAGPackage.SA_GMODEL__ACTORS:
return ((InternalEList<?>)getActors()).basicRemove(otherEnd, 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 SAGPackage.SA_GMODEL__GOALS:
return getGoals();
case SAGPackage.SA_GMODEL__ACTORS:
return getActors();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SAGPackage.SA_GMODEL__GOALS:
getGoals().clear();
getGoals().addAll((Collection<? extends Goal>)newValue);
return;
case SAGPackage.SA_GMODEL__ACTORS:
getActors().clear();
getActors().addAll((Collection<? extends Actor>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SAGPackage.SA_GMODEL__GOALS:
getGoals().clear();
return;
case SAGPackage.SA_GMODEL__ACTORS:
getActors().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SAGPackage.SA_GMODEL__GOALS:
return goals != null && !goals.isEmpty();
case SAGPackage.SA_GMODEL__ACTORS:
return actors != null && !actors.isEmpty();
}
return super.eIsSet(featureID);
}
} //SAGmodelImpl