/** * Copyright (c) 2008, 2009 Borland Software Corp. * * 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 * * Contributors: * Alexander Shatalin (Borland) - initial API and implementation * * $Id$ */ package org.eclipse.gmf.tests.xpand.migration.testModel.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.gmf.tests.xpand.migration.testModel.DefaultAttributeContainer; import org.eclipse.gmf.tests.xpand.migration.testModel.MigrationTestsPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Default Attribute Container</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.gmf.tests.xpand.migration.testModel.impl.DefaultAttributeContainerImpl#isDefault <em>Default</em>}</li> * </ul> * </p> * * @generated */ public class DefaultAttributeContainerImpl extends EObjectImpl implements DefaultAttributeContainer { /** * The default value of the '{@link #isDefault() <em>Default</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isDefault() * @generated * @ordered */ protected static final boolean DEFAULT_EDEFAULT = false; /** * The cached value of the '{@link #isDefault() <em>Default</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isDefault() * @generated * @ordered */ protected boolean default_ = DEFAULT_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DefaultAttributeContainerImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return MigrationTestsPackage.Literals.DEFAULT_ATTRIBUTE_CONTAINER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isDefault() { return default_; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDefault(boolean newDefault) { boolean oldDefault = default_; default_ = newDefault; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, MigrationTestsPackage.DEFAULT_ATTRIBUTE_CONTAINER__DEFAULT, oldDefault, default_)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case MigrationTestsPackage.DEFAULT_ATTRIBUTE_CONTAINER__DEFAULT: return isDefault(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case MigrationTestsPackage.DEFAULT_ATTRIBUTE_CONTAINER__DEFAULT: setDefault((Boolean)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case MigrationTestsPackage.DEFAULT_ATTRIBUTE_CONTAINER__DEFAULT: setDefault(DEFAULT_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case MigrationTestsPackage.DEFAULT_ATTRIBUTE_CONTAINER__DEFAULT: return default_ != DEFAULT_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (default: "); result.append(default_); result.append(')'); return result.toString(); } } //DefaultAttributeContainerImpl