blob: f1ab48eb393ba44aab6d3357c32543c8b12fcf27 [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.IntegerDistribution;
import org.eclipse.app4mc.amalthea.generator.configuration.LabelProperties;
import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage;
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;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Label Properties</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.LabelPropertiesImpl#getCount <em>Count</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.LabelPropertiesImpl#getBitSize <em>Bit Size</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.LabelPropertiesImpl#getPerSWC <em>Per SWC</em>}</li>
* </ul>
*
* @generated
*/
public class LabelPropertiesImpl extends MinimalEObjectImpl.Container implements LabelProperties {
/**
* The cached value of the '{@link #getCount() <em>Count</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCount()
* @generated
* @ordered
*/
protected IntegerDistribution count;
/**
* The cached value of the '{@link #getBitSize() <em>Bit Size</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBitSize()
* @generated
* @ordered
*/
protected IntegerDistribution bitSize;
/**
* The cached value of the '{@link #getPerSWC() <em>Per SWC</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPerSWC()
* @generated
* @ordered
*/
protected IntegerDistribution perSWC;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LabelPropertiesImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.LABEL_PROPERTIES;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IntegerDistribution getCount() {
return count;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCount(IntegerDistribution newCount, NotificationChain msgs) {
IntegerDistribution oldCount = count;
count = newCount;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__COUNT, oldCount, newCount);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCount(IntegerDistribution newCount) {
if (newCount != count) {
NotificationChain msgs = null;
if (count != null)
msgs = ((InternalEObject)count).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__COUNT, null, msgs);
if (newCount != null)
msgs = ((InternalEObject)newCount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__COUNT, null, msgs);
msgs = basicSetCount(newCount, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__COUNT, newCount, newCount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IntegerDistribution getBitSize() {
return bitSize;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBitSize(IntegerDistribution newBitSize, NotificationChain msgs) {
IntegerDistribution oldBitSize = bitSize;
bitSize = newBitSize;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE, oldBitSize, newBitSize);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBitSize(IntegerDistribution newBitSize) {
if (newBitSize != bitSize) {
NotificationChain msgs = null;
if (bitSize != null)
msgs = ((InternalEObject)bitSize).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE, null, msgs);
if (newBitSize != null)
msgs = ((InternalEObject)newBitSize).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE, null, msgs);
msgs = basicSetBitSize(newBitSize, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE, newBitSize, newBitSize));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IntegerDistribution getPerSWC() {
return perSWC;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPerSWC(IntegerDistribution newPerSWC, NotificationChain msgs) {
IntegerDistribution oldPerSWC = perSWC;
perSWC = newPerSWC;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__PER_SWC, oldPerSWC, newPerSWC);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPerSWC(IntegerDistribution newPerSWC) {
if (newPerSWC != perSWC) {
NotificationChain msgs = null;
if (perSWC != null)
msgs = ((InternalEObject)perSWC).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__PER_SWC, null, msgs);
if (newPerSWC != null)
msgs = ((InternalEObject)newPerSWC).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RTMGCPackage.LABEL_PROPERTIES__PER_SWC, null, msgs);
msgs = basicSetPerSWC(newPerSWC, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.LABEL_PROPERTIES__PER_SWC, newPerSWC, newPerSWC));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RTMGCPackage.LABEL_PROPERTIES__COUNT:
return basicSetCount(null, msgs);
case RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE:
return basicSetBitSize(null, msgs);
case RTMGCPackage.LABEL_PROPERTIES__PER_SWC:
return basicSetPerSWC(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.LABEL_PROPERTIES__COUNT:
return getCount();
case RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE:
return getBitSize();
case RTMGCPackage.LABEL_PROPERTIES__PER_SWC:
return getPerSWC();
}
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.LABEL_PROPERTIES__COUNT:
setCount((IntegerDistribution)newValue);
return;
case RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE:
setBitSize((IntegerDistribution)newValue);
return;
case RTMGCPackage.LABEL_PROPERTIES__PER_SWC:
setPerSWC((IntegerDistribution)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.LABEL_PROPERTIES__COUNT:
setCount((IntegerDistribution)null);
return;
case RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE:
setBitSize((IntegerDistribution)null);
return;
case RTMGCPackage.LABEL_PROPERTIES__PER_SWC:
setPerSWC((IntegerDistribution)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RTMGCPackage.LABEL_PROPERTIES__COUNT:
return count != null;
case RTMGCPackage.LABEL_PROPERTIES__BIT_SIZE:
return bitSize != null;
case RTMGCPackage.LABEL_PROPERTIES__PER_SWC:
return perSWC != null;
}
return super.eIsSet(featureID);
}
} //LabelPropertiesImpl