blob: 1a714458c18bf7036455d70e204b5275ec8103eb [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.IntegerTimeDistribution;
import org.eclipse.app4mc.amalthea.generator.configuration.PeriodicActivation;
import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage;
import org.eclipse.app4mc.amalthea.generator.configuration.Recurrence;
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 Activation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PeriodicActivationImpl#getRecurrence <em>Recurrence</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.PeriodicActivationImpl#getOffset <em>Offset</em>}</li>
* </ul>
*
* @generated
*/
public class PeriodicActivationImpl extends ActivationImpl implements PeriodicActivation {
/**
* The cached value of the '{@link #getRecurrence() <em>Recurrence</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRecurrence()
* @generated
* @ordered
*/
protected Recurrence recurrence;
/**
* The cached value of the '{@link #getOffset() <em>Offset</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOffset()
* @generated
* @ordered
*/
protected IntegerTimeDistribution offset;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PeriodicActivationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.PERIODIC_ACTIVATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Recurrence getRecurrence() {
return recurrence;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRecurrence(Recurrence newRecurrence, NotificationChain msgs) {
Recurrence oldRecurrence = recurrence;
recurrence = newRecurrence;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE, oldRecurrence, newRecurrence);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRecurrence(Recurrence newRecurrence) {
if (newRecurrence != recurrence) {
NotificationChain msgs = null;
if (recurrence != null)
msgs = ((InternalEObject)recurrence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE, null, msgs);
if (newRecurrence != null)
msgs = ((InternalEObject)newRecurrence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE, null, msgs);
msgs = basicSetRecurrence(newRecurrence, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE, newRecurrence, newRecurrence));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IntegerTimeDistribution getOffset() {
return offset;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOffset(IntegerTimeDistribution newOffset, NotificationChain msgs) {
IntegerTimeDistribution oldOffset = offset;
offset = newOffset;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_ACTIVATION__OFFSET, oldOffset, newOffset);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOffset(IntegerTimeDistribution newOffset) {
if (newOffset != offset) {
NotificationChain msgs = null;
if (offset != null)
msgs = ((InternalEObject)offset).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_ACTIVATION__OFFSET, null, msgs);
if (newOffset != null)
msgs = ((InternalEObject)newOffset).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.PERIODIC_ACTIVATION__OFFSET, null, msgs);
msgs = basicSetOffset(newOffset, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.PERIODIC_ACTIVATION__OFFSET, newOffset, newOffset));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE:
return basicSetRecurrence(null, msgs);
case RTMGCPackage.PERIODIC_ACTIVATION__OFFSET:
return basicSetOffset(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_ACTIVATION__RECURRENCE:
return getRecurrence();
case RTMGCPackage.PERIODIC_ACTIVATION__OFFSET:
return getOffset();
}
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_ACTIVATION__RECURRENCE:
setRecurrence((Recurrence)newValue);
return;
case RTMGCPackage.PERIODIC_ACTIVATION__OFFSET:
setOffset((IntegerTimeDistribution)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE:
setRecurrence((Recurrence)null);
return;
case RTMGCPackage.PERIODIC_ACTIVATION__OFFSET:
setOffset((IntegerTimeDistribution)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RTMGCPackage.PERIODIC_ACTIVATION__RECURRENCE:
return recurrence != null;
case RTMGCPackage.PERIODIC_ACTIVATION__OFFSET:
return offset != null;
}
return super.eIsSet(featureID);
}
} //PeriodicActivationImpl