| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: BorrowerImpl.java,v 1.1 2006/08/14 05:08:59 mtaal Exp $ |
| */ |
| package extlibrary.impl; |
| |
| import extlibrary.Borrower; |
| import extlibrary.ExtlibraryPackage; |
| import extlibrary.Lendable; |
| |
| 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.EObjectWithInverseResolvingEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Borrower</b></em>'. <!-- |
| * end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link extlibrary.impl.BorrowerImpl#getBorrowed <em>Borrowed</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class BorrowerImpl extends PersonImpl implements Borrower { |
| /** |
| * The cached value of the '{@link #getBorrowed() <em>Borrowed</em>}' reference list. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getBorrowed() |
| * @generated |
| * @ordered |
| */ |
| protected EList borrowed = null; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected BorrowerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return ExtlibraryPackage.Literals.BORROWER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EList getBorrowed() { |
| if (borrowed == null) { |
| borrowed = new EObjectWithInverseResolvingEList.ManyInverse(Lendable.class, this, |
| ExtlibraryPackage.BORROWER__BORROWED, ExtlibraryPackage.LENDABLE__BORROWERS); |
| } |
| return borrowed; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, |
| NotificationChain msgs) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| return ((InternalEList) getBorrowed()).basicAdd(otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, |
| NotificationChain msgs) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| return ((InternalEList) getBorrowed()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| return getBorrowed(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| getBorrowed().clear(); |
| getBorrowed().addAll((Collection) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| getBorrowed().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ExtlibraryPackage.BORROWER__BORROWED: |
| return borrowed != null && !borrowed.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // BorrowerImpl |