/** * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * 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 * * Based on ideas from Xtext, Xtend, Xcore * * Contributors{ * Joerg Riegel - Initial implementation * */ package org.eclipse.osbp.xtext.table.impl; 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.osbp.xtext.table.TableDSLPackage; import org.eclipse.osbp.xtext.table.TableIntLookup; import org.eclipse.osbp.xtext.table.TableRangeElement; /** * * An implementation of the model object 'Table Int Lookup'. * *

* The following features are implemented: *

* * * @generated */ public class TableIntLookupImpl extends TableLazyResolverImpl implements TableIntLookup { /** * The default value of the '{@link #getLookupValue() Lookup Value}' attribute. * * * @see #getLookupValue() * @generated * @ordered */ protected static final int LOOKUP_VALUE_EDEFAULT = 0; /** * The cached value of the '{@link #getLookupValue() Lookup Value}' attribute. * * * @see #getLookupValue() * @generated * @ordered */ protected int lookupValue = LOOKUP_VALUE_EDEFAULT; /** * The cached value of the '{@link #getDiscrete() Discrete}' containment reference. * * * @see #getDiscrete() * @generated * @ordered */ protected TableRangeElement discrete; /** * * * @generated */ protected TableIntLookupImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return TableDSLPackage.Literals.TABLE_INT_LOOKUP; } /** * * * @generated */ public int getLookupValue() { return lookupValue; } /** * * * @generated */ public void setLookupValue(int newLookupValue) { int oldLookupValue = lookupValue; lookupValue = newLookupValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_INT_LOOKUP__LOOKUP_VALUE, oldLookupValue, lookupValue)); } /** * * * @generated */ public TableRangeElement getDiscrete() { return discrete; } /** * * * @generated */ public NotificationChain basicSetDiscrete(TableRangeElement newDiscrete, NotificationChain msgs) { TableRangeElement oldDiscrete = discrete; discrete = newDiscrete; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE, oldDiscrete, newDiscrete); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setDiscrete(TableRangeElement newDiscrete) { if (newDiscrete != discrete) { NotificationChain msgs = null; if (discrete != null) msgs = ((InternalEObject)discrete).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE, null, msgs); if (newDiscrete != null) msgs = ((InternalEObject)newDiscrete).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE, null, msgs); msgs = basicSetDiscrete(newDiscrete, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE, newDiscrete, newDiscrete)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE: return basicSetDiscrete(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case TableDSLPackage.TABLE_INT_LOOKUP__LOOKUP_VALUE: return getLookupValue(); case TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE: return getDiscrete(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TableDSLPackage.TABLE_INT_LOOKUP__LOOKUP_VALUE: setLookupValue((Integer)newValue); return; case TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE: setDiscrete((TableRangeElement)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case TableDSLPackage.TABLE_INT_LOOKUP__LOOKUP_VALUE: setLookupValue(LOOKUP_VALUE_EDEFAULT); return; case TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE: setDiscrete((TableRangeElement)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case TableDSLPackage.TABLE_INT_LOOKUP__LOOKUP_VALUE: return lookupValue != LOOKUP_VALUE_EDEFAULT; case TableDSLPackage.TABLE_INT_LOOKUP__DISCRETE: return discrete != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (lookupValue: "); result.append(lookupValue); result.append(')'); return result.toString(); } } //TableIntLookupImpl