blob: 86bbfd40d4858effb497f262350c7155dcba4599 [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.EventChain;
import org.eclipse.app4mc.amalthea.model.EventChainLatencyConstraint;
import org.eclipse.app4mc.amalthea.model.LatencyType;
import org.eclipse.app4mc.amalthea.model.Time;
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>Event Chain Latency Constraint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.EventChainLatencyConstraintImpl#getScope <em>Scope</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.EventChainLatencyConstraintImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.EventChainLatencyConstraintImpl#getMinimum <em>Minimum</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.EventChainLatencyConstraintImpl#getMaximum <em>Maximum</em>}</li>
* </ul>
*
* @generated
*/
public class EventChainLatencyConstraintImpl extends TimingConstraintImpl implements EventChainLatencyConstraint {
/**
* The cached value of the '{@link #getScope() <em>Scope</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScope()
* @generated
* @ordered
*/
protected EventChain scope;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final LatencyType TYPE_EDEFAULT = LatencyType._UNDEFINED_;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected LatencyType type = TYPE_EDEFAULT;
/**
* The cached value of the '{@link #getMinimum() <em>Minimum</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMinimum()
* @generated
* @ordered
*/
protected Time minimum;
/**
* The cached value of the '{@link #getMaximum() <em>Maximum</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMaximum()
* @generated
* @ordered
*/
protected Time maximum;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EventChainLatencyConstraintImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getEventChainLatencyConstraint();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EventChain getScope() {
if (scope != null && scope.eIsProxy()) {
InternalEObject oldScope = (InternalEObject)scope;
scope = (EventChain)eResolveProxy(oldScope);
if (scope != oldScope) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE, oldScope, scope));
}
}
return scope;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EventChain basicGetScope() {
return scope;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setScope(EventChain newScope) {
EventChain oldScope = scope;
scope = newScope;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE, oldScope, scope));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public LatencyType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setType(LatencyType newType) {
LatencyType oldType = type;
type = newType == null ? TYPE_EDEFAULT : newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Time getMinimum() {
return minimum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMinimum(Time newMinimum, NotificationChain msgs) {
Time oldMinimum = minimum;
minimum = newMinimum;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM, oldMinimum, newMinimum);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMinimum(Time newMinimum) {
if (newMinimum != minimum) {
NotificationChain msgs = null;
if (minimum != null)
msgs = ((InternalEObject)minimum).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM, null, msgs);
if (newMinimum != null)
msgs = ((InternalEObject)newMinimum).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM, null, msgs);
msgs = basicSetMinimum(newMinimum, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM, newMinimum, newMinimum));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Time getMaximum() {
return maximum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMaximum(Time newMaximum, NotificationChain msgs) {
Time oldMaximum = maximum;
maximum = newMaximum;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM, oldMaximum, newMaximum);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMaximum(Time newMaximum) {
if (newMaximum != maximum) {
NotificationChain msgs = null;
if (maximum != null)
msgs = ((InternalEObject)maximum).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM, null, msgs);
if (newMaximum != null)
msgs = ((InternalEObject)newMaximum).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM, null, msgs);
msgs = basicSetMaximum(newMaximum, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM, newMaximum, newMaximum));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM:
return basicSetMinimum(null, msgs);
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM:
return basicSetMaximum(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 AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE:
if (resolve) return getScope();
return basicGetScope();
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__TYPE:
return getType();
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM:
return getMinimum();
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM:
return getMaximum();
}
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.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE:
setScope((EventChain)newValue);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__TYPE:
setType((LatencyType)newValue);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM:
setMinimum((Time)newValue);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM:
setMaximum((Time)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE:
setScope((EventChain)null);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__TYPE:
setType(TYPE_EDEFAULT);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM:
setMinimum((Time)null);
return;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM:
setMaximum((Time)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__SCOPE:
return scope != null;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__TYPE:
return type != TYPE_EDEFAULT;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MINIMUM:
return minimum != null;
case AmaltheaPackage.EVENT_CHAIN_LATENCY_CONSTRAINT__MAXIMUM:
return maximum != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (type: ");
result.append(type);
result.append(')');
return result.toString();
}
} //EventChainLatencyConstraintImpl