blob: d78629f84f3f376fe182ae3da098aebb664963f8 [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.Collection;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.AmaltheaServices2;
import org.eclipse.app4mc.amalthea.model.ContinuousValueHistogram;
import org.eclipse.app4mc.amalthea.model.ContinuousValueHistogramEntry;
import org.eclipse.app4mc.amalthea.model.emf.AmaltheaEObjectImpl;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Continuous Value Histogram</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ContinuousValueHistogramImpl#getEntries <em>Entries</em>}</li>
* </ul>
*
* @generated
*/
public class ContinuousValueHistogramImpl extends AmaltheaEObjectImpl implements ContinuousValueHistogram {
/**
* The cached value of the '{@link #getEntries() <em>Entries</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntries()
* @generated
* @ordered
*/
protected EList<ContinuousValueHistogramEntry> entries;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ContinuousValueHistogramImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getContinuousValueHistogram();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<ContinuousValueHistogramEntry> getEntries() {
if (entries == null) {
entries = new EObjectContainmentEList<ContinuousValueHistogramEntry>(ContinuousValueHistogramEntry.class, this, AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES);
}
return entries;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Double getLowerBound() {
return AmaltheaServices2.getLowerBound_CV(this.getEntries());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Double getUpperBound() {
return AmaltheaServices2.getUpperBound_CV(this.getEntries());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Double getAverage() {
return AmaltheaServices2.getAverage_CV(this.getEntries());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES:
return ((InternalEList<?>)getEntries()).basicRemove(otherEnd, 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.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES:
return getEntries();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES:
getEntries().clear();
getEntries().addAll((Collection<? extends ContinuousValueHistogramEntry>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES:
getEntries().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM__ENTRIES:
return entries != null && !entries.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM___GET_LOWER_BOUND:
return getLowerBound();
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM___GET_UPPER_BOUND:
return getUpperBound();
case AmaltheaPackage.CONTINUOUS_VALUE_HISTOGRAM___GET_AVERAGE:
return getAverage();
}
return super.eInvoke(operationID, arguments);
}
} //ContinuousValueHistogramImpl