/** * Copyright (c) 2011 Object Management Group (SAEM metamodel) * Copyright (c) 2010-2011 United States Government as represented by the Administrator for The National Aeronautics and Space Administration. All Rights Reserved. */ package net.certware.evidence.evidence.impl; import java.util.Collection; import net.certware.evidence.evidence.EvidencePackage; import net.certware.evidence.evidence.HasRoleIn; import net.certware.evidence.evidence.Person; 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.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Person</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.certware.evidence.evidence.impl.PersonImpl#getAffiliation <em>Affiliation</em>}</li> * </ul> * </p> * * @generated */ public class PersonImpl extends OriginatorImpl implements Person { /** * The cached value of the '{@link #getAffiliation() <em>Affiliation</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAffiliation() * @generated * @ordered */ protected EList<HasRoleIn> affiliation; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PersonImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return EvidencePackage.Literals.PERSON; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<HasRoleIn> getAffiliation() { if (affiliation == null) { affiliation = new EObjectContainmentEList<HasRoleIn>(HasRoleIn.class, this, EvidencePackage.PERSON__AFFILIATION); } return affiliation; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case EvidencePackage.PERSON__AFFILIATION: return ((InternalEList<?>)getAffiliation()).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 EvidencePackage.PERSON__AFFILIATION: return getAffiliation(); } 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 EvidencePackage.PERSON__AFFILIATION: getAffiliation().clear(); getAffiliation().addAll((Collection<? extends HasRoleIn>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EvidencePackage.PERSON__AFFILIATION: getAffiliation().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EvidencePackage.PERSON__AFFILIATION: return affiliation != null && !affiliation.isEmpty(); } return super.eIsSet(featureID); } } //PersonImpl