/** * <copyright> * </copyright> * * $Id$ */ package orgomg.cwm.objectmodel.core.impl; 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.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; import orgomg.cwm.objectmodel.core.CorePackage; import orgomg.cwm.objectmodel.core.Multiplicity; import orgomg.cwm.objectmodel.core.MultiplicityRange; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Multiplicity</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link orgomg.cwm.objectmodel.core.impl.MultiplicityImpl#getRange <em>Range</em>}</li> * </ul> * </p> * * @generated */ public class MultiplicityImpl extends ElementImpl implements Multiplicity { /** * The cached value of the '{@link #getRange() <em>Range</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRange() * @generated * @ordered */ protected EList<MultiplicityRange> range; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MultiplicityImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CorePackage.Literals.MULTIPLICITY; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<MultiplicityRange> getRange() { if (range == null) { range = new EObjectContainmentWithInverseEList<MultiplicityRange>(MultiplicityRange.class, this, CorePackage.MULTIPLICITY__RANGE, CorePackage.MULTIPLICITY_RANGE__MULTIPLICITY); } return range; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CorePackage.MULTIPLICITY__RANGE: return ((InternalEList<InternalEObject>)(InternalEList<?>)getRange()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CorePackage.MULTIPLICITY__RANGE: return ((InternalEList<?>)getRange()).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 CorePackage.MULTIPLICITY__RANGE: return getRange(); } 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 CorePackage.MULTIPLICITY__RANGE: getRange().clear(); getRange().addAll((Collection<? extends MultiplicityRange>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CorePackage.MULTIPLICITY__RANGE: getRange().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CorePackage.MULTIPLICITY__RANGE: return range != null && !range.isEmpty(); } return super.eIsSet(featureID); } } //MultiplicityImpl