/**
* <copyright>
* </copyright>
*
* $Id$
*/
package AIP.impl;
import AIP.AIPPackage;
import AIP.AIPmodel;
import AIP.Participant;
import AIP.Protocol;
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>AI Pmodel</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link AIP.impl.AIPmodelImpl#getParticipants <em>Participants</em>}</li>
* <li>{@link AIP.impl.AIPmodelImpl#getProtocols <em>Protocols</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AIPmodelImpl extends EObjectImpl implements AIPmodel {
/**
* The cached value of the '{@link #getParticipants() <em>Participants</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParticipants()
* @generated
* @ordered
*/
protected EList<Participant> participants;
/**
* The cached value of the '{@link #getProtocols() <em>Protocols</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProtocols()
* @generated
* @ordered
*/
protected EList<Protocol> protocols;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AIPmodelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AIPPackage.Literals.AI_PMODEL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Participant> getParticipants() {
if (participants == null) {
participants = new EObjectContainmentEList<Participant>(Participant.class, this, AIPPackage.AI_PMODEL__PARTICIPANTS);
}
return participants;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Protocol> getProtocols() {
if (protocols == null) {
protocols = new EObjectContainmentEList<Protocol>(Protocol.class, this, AIPPackage.AI_PMODEL__PROTOCOLS);
}
return protocols;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AIPPackage.AI_PMODEL__PARTICIPANTS:
return ((InternalEList<?>)getParticipants()).basicRemove(otherEnd, msgs);
case AIPPackage.AI_PMODEL__PROTOCOLS:
return ((InternalEList<?>)getProtocols()).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 AIPPackage.AI_PMODEL__PARTICIPANTS:
return getParticipants();
case AIPPackage.AI_PMODEL__PROTOCOLS:
return getProtocols();
}
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 AIPPackage.AI_PMODEL__PARTICIPANTS:
getParticipants().clear();
getParticipants().addAll((Collection<? extends Participant>)newValue);
return;
case AIPPackage.AI_PMODEL__PROTOCOLS:
getProtocols().clear();
getProtocols().addAll((Collection<? extends Protocol>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AIPPackage.AI_PMODEL__PARTICIPANTS:
getParticipants().clear();
return;
case AIPPackage.AI_PMODEL__PROTOCOLS:
getProtocols().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AIPPackage.AI_PMODEL__PARTICIPANTS:
return participants != null && !participants.isEmpty();
case AIPPackage.AI_PMODEL__PROTOCOLS:
return protocols != null && !protocols.isEmpty();
}
return super.eIsSet(featureID);
}
} //AIPmodelImpl