blob: 4cdf1be7fa16acd79e1bbbac7c8b53e63075fd24 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.Channel;
import org.eclipse.app4mc.amalthea.model.ComponentInterface;
import org.eclipse.app4mc.amalthea.model.emf.AmaltheaEObjectImpl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Interface Channel</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.InterfaceChannelImpl#getTypedKey <em>Key</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.InterfaceChannelImpl#getTypedValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class InterfaceChannelImpl extends AmaltheaEObjectImpl implements BasicEMap.Entry<ComponentInterface,Channel> {
/**
* The cached value of the '{@link #getTypedKey() <em>Key</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTypedKey()
* @generated
* @ordered
*/
protected ComponentInterface key;
/**
* The cached value of the '{@link #getTypedValue() <em>Value</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTypedValue()
* @generated
* @ordered
*/
protected Channel value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InterfaceChannelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getInterfaceChannel();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentInterface getTypedKey() {
if (key != null && key.eIsProxy()) {
InternalEObject oldKey = (InternalEObject)key;
key = (ComponentInterface)eResolveProxy(oldKey);
if (key != oldKey) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.INTERFACE_CHANNEL__KEY, oldKey, key));
}
}
return key;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentInterface basicGetTypedKey() {
return key;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTypedKey(ComponentInterface newKey) {
ComponentInterface oldKey = key;
key = newKey;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.INTERFACE_CHANNEL__KEY, oldKey, key));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Channel getTypedValue() {
if (value != null && value.eIsProxy()) {
InternalEObject oldValue = (InternalEObject)value;
value = (Channel)eResolveProxy(oldValue);
if (value != oldValue) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.INTERFACE_CHANNEL__VALUE, oldValue, value));
}
}
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Channel basicGetTypedValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTypedValue(Channel newValue) {
Channel oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.INTERFACE_CHANNEL__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.INTERFACE_CHANNEL__KEY:
if (resolve) return getTypedKey();
return basicGetTypedKey();
case AmaltheaPackage.INTERFACE_CHANNEL__VALUE:
if (resolve) return getTypedValue();
return basicGetTypedValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.INTERFACE_CHANNEL__KEY:
setTypedKey((ComponentInterface)newValue);
return;
case AmaltheaPackage.INTERFACE_CHANNEL__VALUE:
setTypedValue((Channel)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.INTERFACE_CHANNEL__KEY:
setTypedKey((ComponentInterface)null);
return;
case AmaltheaPackage.INTERFACE_CHANNEL__VALUE:
setTypedValue((Channel)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.INTERFACE_CHANNEL__KEY:
return key != null;
case AmaltheaPackage.INTERFACE_CHANNEL__VALUE:
return value != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected int hash = -1;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int getHash() {
if (hash == -1) {
Object theKey = getKey();
hash = (theKey == null ? 0 : theKey.hashCode());
}
return hash;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setHash(int hash) {
this.hash = hash;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ComponentInterface getKey() {
return getTypedKey();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setKey(ComponentInterface key) {
setTypedKey(key);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Channel getValue() {
return getTypedValue();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Channel setValue(Channel value) {
Channel oldValue = getValue();
setTypedValue(value);
return oldValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
public EMap<ComponentInterface, Channel> getEMap() {
EObject container = eContainer();
return container == null ? null : (EMap<ComponentInterface, Channel>)container.eGet(eContainmentFeature());
}
} //InterfaceChannelImpl