Switch to side-by-side view

--- a
+++ b/src/main/java/genericbcm/impl/DependencyImpl.java
@@ -0,0 +1,270 @@
+/**
+ */
+package genericbcm.impl;
+
+import genericbcm.Dependency;
+import genericbcm.GenericbcmPackage;
+import genericbcm.Resource;
+import genericbcm.Unit;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Dependency</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link genericbcm.impl.DependencyImpl#getOn <em>On</em>}</li>
+ *   <li>{@link genericbcm.impl.DependencyImpl#getFrom <em>From</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DependencyImpl extends ThreatImpl implements Dependency {
+	/**
+	 * The cached value of the '{@link #getOn() <em>On</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getOn()
+	 * @generated
+	 * @ordered
+	 */
+	protected Unit on;
+
+	/**
+	 * The cached value of the '{@link #getFrom() <em>From</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getFrom()
+	 * @generated
+	 * @ordered
+	 */
+	protected Resource from;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected DependencyImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return GenericbcmPackage.Literals.DEPENDENCY;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Unit getOn() {
+		if (on != null && on.eIsProxy()) {
+			InternalEObject oldOn = (InternalEObject)on;
+			on = (Unit)eResolveProxy(oldOn);
+			if (on != oldOn) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.DEPENDENCY__ON, oldOn, on));
+			}
+		}
+		return on;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Unit basicGetOn() {
+		return on;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetOn(Unit newOn, NotificationChain msgs) {
+		Unit oldOn = on;
+		on = newOn;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GenericbcmPackage.DEPENDENCY__ON, oldOn, newOn);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setOn(Unit newOn) {
+		if (newOn != on) {
+			NotificationChain msgs = null;
+			if (on != null)
+				msgs = ((InternalEObject)on).eInverseRemove(this, GenericbcmPackage.UNIT__INCOMMING_DEPENDENCIES, Unit.class, msgs);
+			if (newOn != null)
+				msgs = ((InternalEObject)newOn).eInverseAdd(this, GenericbcmPackage.UNIT__INCOMMING_DEPENDENCIES, Unit.class, msgs);
+			msgs = basicSetOn(newOn, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.DEPENDENCY__ON, newOn, newOn));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Resource getFrom() {
+		if (from != null && from.eIsProxy()) {
+			InternalEObject oldFrom = (InternalEObject)from;
+			from = (Resource)eResolveProxy(oldFrom);
+			if (from != oldFrom) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.DEPENDENCY__FROM, oldFrom, from));
+			}
+		}
+		return from;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Resource basicGetFrom() {
+		return from;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setFrom(Resource newFrom) {
+		Resource oldFrom = from;
+		from = newFrom;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.DEPENDENCY__FROM, oldFrom, from));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case GenericbcmPackage.DEPENDENCY__ON:
+				if (on != null)
+					msgs = ((InternalEObject)on).eInverseRemove(this, GenericbcmPackage.UNIT__INCOMMING_DEPENDENCIES, Unit.class, msgs);
+				return basicSetOn((Unit)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 GenericbcmPackage.DEPENDENCY__ON:
+				return basicSetOn(null, 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 GenericbcmPackage.DEPENDENCY__ON:
+				if (resolve) return getOn();
+				return basicGetOn();
+			case GenericbcmPackage.DEPENDENCY__FROM:
+				if (resolve) return getFrom();
+				return basicGetFrom();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case GenericbcmPackage.DEPENDENCY__ON:
+				setOn((Unit)newValue);
+				return;
+			case GenericbcmPackage.DEPENDENCY__FROM:
+				setFrom((Resource)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case GenericbcmPackage.DEPENDENCY__ON:
+				setOn((Unit)null);
+				return;
+			case GenericbcmPackage.DEPENDENCY__FROM:
+				setFrom((Resource)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case GenericbcmPackage.DEPENDENCY__ON:
+				return on != null;
+			case GenericbcmPackage.DEPENDENCY__FROM:
+				return from != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+} //DependencyImpl