blob: 96308cc4f65cfb536768d9e78ad7273390860053 [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.util.Collection;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.Clock;
import org.eclipse.app4mc.amalthea.model.StimuliModel;
import org.eclipse.app4mc.amalthea.model.Stimulus;
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>Stimuli Model</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.StimuliModelImpl#getStimuli <em>Stimuli</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.StimuliModelImpl#getClocks <em>Clocks</em>}</li>
* </ul>
*
* @generated
*/
public class StimuliModelImpl extends BaseObjectImpl implements StimuliModel {
/**
* The cached value of the '{@link #getStimuli() <em>Stimuli</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStimuli()
* @generated
* @ordered
*/
protected EList<Stimulus> stimuli;
/**
* The cached value of the '{@link #getClocks() <em>Clocks</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClocks()
* @generated
* @ordered
*/
protected EList<Clock> clocks;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StimuliModelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getStimuliModel();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Stimulus> getStimuli() {
if (stimuli == null) {
stimuli = new EObjectContainmentEList<Stimulus>(Stimulus.class, this, AmaltheaPackage.STIMULI_MODEL__STIMULI);
}
return stimuli;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Clock> getClocks() {
if (clocks == null) {
clocks = new EObjectContainmentEList<Clock>(Clock.class, this, AmaltheaPackage.STIMULI_MODEL__CLOCKS);
}
return clocks;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AmaltheaPackage.STIMULI_MODEL__STIMULI:
return ((InternalEList<?>)getStimuli()).basicRemove(otherEnd, msgs);
case AmaltheaPackage.STIMULI_MODEL__CLOCKS:
return ((InternalEList<?>)getClocks()).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.STIMULI_MODEL__STIMULI:
return getStimuli();
case AmaltheaPackage.STIMULI_MODEL__CLOCKS:
return getClocks();
}
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.STIMULI_MODEL__STIMULI:
getStimuli().clear();
getStimuli().addAll((Collection<? extends Stimulus>)newValue);
return;
case AmaltheaPackage.STIMULI_MODEL__CLOCKS:
getClocks().clear();
getClocks().addAll((Collection<? extends Clock>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.STIMULI_MODEL__STIMULI:
getStimuli().clear();
return;
case AmaltheaPackage.STIMULI_MODEL__CLOCKS:
getClocks().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.STIMULI_MODEL__STIMULI:
return stimuli != null && !stimuli.isEmpty();
case AmaltheaPackage.STIMULI_MODEL__CLOCKS:
return clocks != null && !clocks.isEmpty();
}
return super.eIsSet(featureID);
}
} //StimuliModelImpl