blob: 316a0163cf5396b16d934dd89a77f7b27b070ef0 [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 java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.AmaltheaValidations;
import org.eclipse.app4mc.amalthea.model.Time;
import org.eclipse.app4mc.amalthea.model.TruncatedTimeDistribution;
import org.eclipse.app4mc.amalthea.model.emf.AmaltheaEObjectImpl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
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>Truncated Time Distribution</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.TruncatedTimeDistributionImpl#getLowerBound <em>Lower Bound</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.TruncatedTimeDistributionImpl#getUpperBound <em>Upper Bound</em>}</li>
* </ul>
*
* @generated
*/
public abstract class TruncatedTimeDistributionImpl extends AmaltheaEObjectImpl implements TruncatedTimeDistribution {
/**
* The cached value of the '{@link #getLowerBound() <em>Lower Bound</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLowerBound()
* @generated
* @ordered
*/
protected Time lowerBound;
/**
* The cached value of the '{@link #getUpperBound() <em>Upper Bound</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUpperBound()
* @generated
* @ordered
*/
protected Time upperBound;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TruncatedTimeDistributionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getTruncatedTimeDistribution();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Time getLowerBound() {
return lowerBound;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLowerBound(Time newLowerBound, NotificationChain msgs) {
Time oldLowerBound = lowerBound;
lowerBound = newLowerBound;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND, oldLowerBound, newLowerBound);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setLowerBound(Time newLowerBound) {
if (newLowerBound != lowerBound) {
NotificationChain msgs = null;
if (lowerBound != null)
msgs = ((InternalEObject)lowerBound).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND, null, msgs);
if (newLowerBound != null)
msgs = ((InternalEObject)newLowerBound).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND, null, msgs);
msgs = basicSetLowerBound(newLowerBound, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND, newLowerBound, newLowerBound));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Time getUpperBound() {
return upperBound;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetUpperBound(Time newUpperBound, NotificationChain msgs) {
Time oldUpperBound = upperBound;
upperBound = newUpperBound;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND, oldUpperBound, newUpperBound);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setUpperBound(Time newUpperBound) {
if (newUpperBound != upperBound) {
NotificationChain msgs = null;
if (upperBound != null)
msgs = ((InternalEObject)upperBound).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND, null, msgs);
if (newUpperBound != null)
msgs = ((InternalEObject)newUpperBound).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND, null, msgs);
msgs = basicSetUpperBound(newUpperBound, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND, newUpperBound, newUpperBound));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean validateInvariants(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
return AmaltheaValidations.validateInvariants(this, diagnostics);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Time getAverage() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND:
return basicSetLowerBound(null, msgs);
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND:
return basicSetUpperBound(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.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND:
return getLowerBound();
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND:
return getUpperBound();
}
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.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND:
setLowerBound((Time)newValue);
return;
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND:
setUpperBound((Time)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND:
setLowerBound((Time)null);
return;
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND:
setUpperBound((Time)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__LOWER_BOUND:
return lowerBound != null;
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION__UPPER_BOUND:
return upperBound != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION___VALIDATE_INVARIANTS__DIAGNOSTICCHAIN_MAP:
return validateInvariants((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case AmaltheaPackage.TRUNCATED_TIME_DISTRIBUTION___GET_AVERAGE:
return getAverage();
}
return super.eInvoke(operationID, arguments);
}
} //TruncatedTimeDistributionImpl