| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package copyException.impl; |
| 8 | |
| 9 | import copyException.CopyExceptionPackage; |
| 10 | import copyException.Import; |
| 11 | import copyException.Model; |
| 12 | |
| 13 | import java.util.Collection; |
| 14 | |
| 15 | import org.eclipse.emf.common.notify.NotificationChain; |
| 16 | |
| 17 | import org.eclipse.emf.common.util.EList; |
| 18 | |
| 19 | import org.eclipse.emf.ecore.EClass; |
| 20 | import org.eclipse.emf.ecore.InternalEObject; |
| 21 | |
| 22 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 23 | |
| 24 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 25 | import org.eclipse.emf.ecore.util.InternalEList; |
| 26 | |
| 27 | /** |
| 28 | * <!-- begin-user-doc --> |
| 29 | * An implementation of the model object '<em><b>Model</b></em>'. |
| 30 | * <!-- end-user-doc --> |
| 31 | * <p> |
| 32 | * The following features are implemented: |
| 33 | * <ul> |
| 34 | * <li>{@link copyException.impl.ModelImpl#getImports <em>Imports</em>}</li> |
| 35 | * <li>{@link copyException.impl.ModelImpl#getExceptions <em>Exceptions</em>}</li> |
| 36 | * </ul> |
| 37 | * </p> |
| 38 | * |
| 39 | * @generated |
| 40 | */ |
| 41 | public class ModelImpl extends EObjectImpl implements Model { |
| 42 | /** |
| 43 | * The cached value of the '{@link #getImports() <em>Imports</em>}' containment reference list. |
| 44 | * <!-- begin-user-doc --> |
| 45 | * <!-- end-user-doc --> |
| 46 | * @see #getImports() |
| 47 | * @generated |
| 48 | * @ordered |
| 49 | */ |
| 50 | protected EList<Import> imports; |
| 51 | |
| 52 | /** |
| 53 | * The cached value of the '{@link #getExceptions() <em>Exceptions</em>}' containment reference list. |
| 54 | * <!-- begin-user-doc --> |
| 55 | * <!-- end-user-doc --> |
| 56 | * @see #getExceptions() |
| 57 | * @generated |
| 58 | * @ordered |
| 59 | */ |
| 60 | protected EList<copyException.Exception> exceptions; |
| 61 | |
| 62 | /** |
| 63 | * <!-- begin-user-doc --> |
| 64 | * <!-- end-user-doc --> |
| 65 | * @generated |
| 66 | */ |
| 67 | protected ModelImpl() { |
| 68 | super(); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <!-- end-user-doc --> |
| 74 | * @generated |
| 75 | */ |
| 76 | @Override |
| 77 | protected EClass eStaticClass() { |
| 78 | return CopyExceptionPackage.Literals.MODEL; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * <!-- begin-user-doc --> |
| 83 | * <!-- end-user-doc --> |
| 84 | * @generated |
| 85 | */ |
| 86 | public EList<Import> getImports() { |
| 87 | if (imports == null) { |
| 88 | imports = new EObjectContainmentEList<Import>(Import.class, this, CopyExceptionPackage.MODEL__IMPORTS); |
| 89 | } |
| 90 | return imports; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * <!-- begin-user-doc --> |
| 95 | * <!-- end-user-doc --> |
| 96 | * @generated |
| 97 | */ |
| 98 | public EList<copyException.Exception> getExceptions() { |
| 99 | if (exceptions == null) { |
| 100 | exceptions = new EObjectContainmentEList<copyException.Exception>(copyException.Exception.class, this, CopyExceptionPackage.MODEL__EXCEPTIONS); |
| 101 | } |
| 102 | return exceptions; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * <!-- begin-user-doc --> |
| 107 | * <!-- end-user-doc --> |
| 108 | * @generated |
| 109 | */ |
| 110 | @Override |
| 111 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 112 | switch (featureID) { |
| 113 | case CopyExceptionPackage.MODEL__IMPORTS: |
| 114 | return ((InternalEList<?>)getImports()).basicRemove(otherEnd, msgs); |
| 115 | case CopyExceptionPackage.MODEL__EXCEPTIONS: |
| 116 | return ((InternalEList<?>)getExceptions()).basicRemove(otherEnd, msgs); |
| 117 | } |
| 118 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * <!-- begin-user-doc --> |
| 123 | * <!-- end-user-doc --> |
| 124 | * @generated |
| 125 | */ |
| 126 | @Override |
| 127 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 128 | switch (featureID) { |
| 129 | case CopyExceptionPackage.MODEL__IMPORTS: |
| 130 | return getImports(); |
| 131 | case CopyExceptionPackage.MODEL__EXCEPTIONS: |
| 132 | return getExceptions(); |
| 133 | } |
| 134 | return super.eGet(featureID, resolve, coreType); |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * <!-- begin-user-doc --> |
| 139 | * <!-- end-user-doc --> |
| 140 | * @generated |
| 141 | */ |
| 142 | @SuppressWarnings("unchecked") |
| 143 | @Override |
| 144 | public void eSet(int featureID, Object newValue) { |
| 145 | switch (featureID) { |
| 146 | case CopyExceptionPackage.MODEL__IMPORTS: |
| 147 | getImports().clear(); |
| 148 | getImports().addAll((Collection<? extends Import>)newValue); |
| 149 | return; |
| 150 | case CopyExceptionPackage.MODEL__EXCEPTIONS: |
| 151 | getExceptions().clear(); |
| 152 | getExceptions().addAll((Collection<? extends copyException.Exception>)newValue); |
| 153 | return; |
| 154 | } |
| 155 | super.eSet(featureID, newValue); |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * <!-- begin-user-doc --> |
| 160 | * <!-- end-user-doc --> |
| 161 | * @generated |
| 162 | */ |
| 163 | @Override |
| 164 | public void eUnset(int featureID) { |
| 165 | switch (featureID) { |
| 166 | case CopyExceptionPackage.MODEL__IMPORTS: |
| 167 | getImports().clear(); |
| 168 | return; |
| 169 | case CopyExceptionPackage.MODEL__EXCEPTIONS: |
| 170 | getExceptions().clear(); |
| 171 | return; |
| 172 | } |
| 173 | super.eUnset(featureID); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * <!-- begin-user-doc --> |
| 178 | * <!-- end-user-doc --> |
| 179 | * @generated |
| 180 | */ |
| 181 | @Override |
| 182 | public boolean eIsSet(int featureID) { |
| 183 | switch (featureID) { |
| 184 | case CopyExceptionPackage.MODEL__IMPORTS: |
| 185 | return imports != null && !imports.isEmpty(); |
| 186 | case CopyExceptionPackage.MODEL__EXCEPTIONS: |
| 187 | return exceptions != null && !exceptions.isEmpty(); |
| 188 | } |
| 189 | return super.eIsSet(featureID); |
| 190 | } |
| 191 | |
| 192 | } //ModelImpl |