blob: 8adab1b236e7ac9dcc00f228b2fa2ae57fad0eac [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2017 Timing-Architects Embedded Systems GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.generator.configuration.impl;
import org.eclipse.app4mc.amalthea.generator.configuration.PeriodicTriangleShift;
import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage;
import org.eclipse.app4mc.amalthea.generator.configuration.TriangleClock;
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>Periodic Triangle Shift</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PeriodicTriangleShiftImpl#getClock <em>Clock</em>}</li>
* </ul>
*
* @generated
*/
public class PeriodicTriangleShiftImpl extends PeriodicActivationImpl implements PeriodicTriangleShift {
/**
* The cached value of the '{@link #getClock() <em>Clock</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClock()
* @generated
* @ordered
*/
protected TriangleClock clock;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PeriodicTriangleShiftImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.PERIODIC_TRIANGLE_SHIFT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TriangleClock getClock() {
return clock;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetClock(TriangleClock newClock, NotificationChain msgs) {
TriangleClock oldClock = clock;
clock = newClock;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK, oldClock, newClock);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setClock(TriangleClock newClock) {
if (newClock != clock) {
NotificationChain msgs = null;
if (clock != null)
msgs = ((InternalEObject)clock).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK, null, msgs);
if (newClock != null)
msgs = ((InternalEObject)newClock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK, null, msgs);
msgs = basicSetClock(newClock, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK, newClock, newClock));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK:
return basicSetClock(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 RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK:
return getClock();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK:
setClock((TriangleClock)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK:
setClock((TriangleClock)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RTMGCPackage.PERIODIC_TRIANGLE_SHIFT__CLOCK:
return clock != null;
}
return super.eIsSet(featureID);
}
} //PeriodicTriangleShiftImpl