| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package com.hammurapi.eventbus.snapshot.impl; |
| 8 | |
| 9 | import com.hammurapi.eventbus.snapshot.Event; |
| 10 | import com.hammurapi.eventbus.snapshot.JoinEntry; |
| 11 | import com.hammurapi.eventbus.snapshot.SnapshotPackage; |
| 12 | |
| 13 | import java.util.Collection; |
| 14 | |
| 15 | import org.eclipse.emf.common.notify.NotificationChain; |
| 16 | import org.eclipse.emf.common.util.EList; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | |
| 20 | import org.eclipse.emf.ecore.InternalEObject; |
| 21 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 22 | |
| 23 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 24 | import org.eclipse.emf.ecore.util.InternalEList; |
| 25 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| 26 | |
| 27 | /** |
| 28 | * <!-- begin-user-doc --> |
| 29 | * An implementation of the model object '<em><b>Join Entry</b></em>'. |
| 30 | * <!-- end-user-doc --> |
| 31 | * <p> |
| 32 | * The following features are implemented: |
| 33 | * <ul> |
| 34 | * <li>{@link com.hammurapi.eventbus.snapshot.impl.JoinEntryImpl#getEvents <em>Events</em>}</li> |
| 35 | * </ul> |
| 36 | * </p> |
| 37 | * |
| 38 | * @generated |
| 39 | */ |
| 40 | public class JoinEntryImpl extends EObjectImpl implements JoinEntry { |
| 41 | /** |
| 42 | * The cached value of the '{@link #getEvents() <em>Events</em>}' reference list. |
| 43 | * <!-- begin-user-doc --> |
| 44 | * <!-- end-user-doc --> |
| 45 | * @see #getEvents() |
| 46 | * @generated |
| 47 | * @ordered |
| 48 | */ |
| 49 | protected EList<Event> events; |
| 50 | |
| 51 | /** |
| 52 | * <!-- begin-user-doc --> |
| 53 | * <!-- end-user-doc --> |
| 54 | * @generated |
| 55 | */ |
| 56 | protected JoinEntryImpl() { |
| 57 | super(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * <!-- begin-user-doc --> |
| 62 | * <!-- end-user-doc --> |
| 63 | * @generated |
| 64 | */ |
| 65 | @Override |
| 66 | protected EClass eStaticClass() { |
| 67 | return SnapshotPackage.Literals.JOIN_ENTRY; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @generated |
| 74 | */ |
| 75 | public EList<Event> getEvents() { |
| 76 | if (events == null) { |
| 77 | events = new EObjectResolvingEList<Event>(Event.class, this, SnapshotPackage.JOIN_ENTRY__EVENTS); |
| 78 | } |
| 79 | return events; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * <!-- begin-user-doc --> |
| 84 | * <!-- end-user-doc --> |
| 85 | * @generated |
| 86 | */ |
| 87 | @Override |
| 88 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 89 | switch (featureID) { |
| 90 | case SnapshotPackage.JOIN_ENTRY__EVENTS: |
| 91 | return getEvents(); |
| 92 | } |
| 93 | return super.eGet(featureID, resolve, coreType); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * <!-- begin-user-doc --> |
| 98 | * <!-- end-user-doc --> |
| 99 | * @generated |
| 100 | */ |
| 101 | @SuppressWarnings("unchecked") |
| 102 | @Override |
| 103 | public void eSet(int featureID, Object newValue) { |
| 104 | switch (featureID) { |
| 105 | case SnapshotPackage.JOIN_ENTRY__EVENTS: |
| 106 | getEvents().clear(); |
| 107 | getEvents().addAll((Collection<? extends Event>)newValue); |
| 108 | return; |
| 109 | } |
| 110 | super.eSet(featureID, newValue); |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * <!-- begin-user-doc --> |
| 115 | * <!-- end-user-doc --> |
| 116 | * @generated |
| 117 | */ |
| 118 | @Override |
| 119 | public void eUnset(int featureID) { |
| 120 | switch (featureID) { |
| 121 | case SnapshotPackage.JOIN_ENTRY__EVENTS: |
| 122 | getEvents().clear(); |
| 123 | return; |
| 124 | } |
| 125 | super.eUnset(featureID); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * <!-- begin-user-doc --> |
| 130 | * <!-- end-user-doc --> |
| 131 | * @generated |
| 132 | */ |
| 133 | @Override |
| 134 | public boolean eIsSet(int featureID) { |
| 135 | switch (featureID) { |
| 136 | case SnapshotPackage.JOIN_ENTRY__EVENTS: |
| 137 | return events != null && !events.isEmpty(); |
| 138 | } |
| 139 | return super.eIsSet(featureID); |
| 140 | } |
| 141 | |
| 142 | } //JoinEntryImpl |