blob: 8f59f9856b82581a76cdf257fc70ac8e85ce0e30 [file] [log] [blame]
/*
* Copyright (c) 2005 Borland Software Corporation
*
* 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:
* Dmitri Stadnik (Borland) - initial API and implementation
*/
package org.eclipse.gmf.examples.taipan.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.examples.taipan.Item;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Item</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.examples.taipan.impl.ItemImpl#getArticle <em>Article</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class ItemImpl extends EObjectImpl implements Item {
/**
* The default value of the '{@link #getArticle() <em>Article</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArticle()
* @generated
* @ordered
*/
protected static final String ARTICLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getArticle() <em>Article</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArticle()
* @generated
* @ordered
*/
protected String article = ARTICLE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ItemImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TaiPanPackage.Literals.ITEM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getArticle() {
return article;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setArticle(String newArticle) {
String oldArticle = article;
article = newArticle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaiPanPackage.ITEM__ARTICLE, oldArticle, article));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TaiPanPackage.ITEM__ARTICLE:
return getArticle();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TaiPanPackage.ITEM__ARTICLE:
setArticle((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TaiPanPackage.ITEM__ARTICLE:
setArticle(ARTICLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TaiPanPackage.ITEM__ARTICLE:
return ARTICLE_EDEFAULT == null ? article != null : !ARTICLE_EDEFAULT.equals(article);
}
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(" (article: "); //$NON-NLS-1$
result.append(article);
result.append(')');
return result.toString();
}
} //ItemImpl