/**
* <copyright>
* </copyright>
*
* $Id$
*/
package SmartGen.impl;
import SmartGen.File;
import SmartGen.SmartGenPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Package</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link SmartGen.impl.PackageImpl#getPackagingKind <em>Packaging Kind</em>}</li>
* <li>{@link SmartGen.impl.PackageImpl#getContent <em>Content</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PackageImpl extends FileImpl implements SmartGen.Package {
/**
* The default value of the '{@link #getPackagingKind() <em>Packaging Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPackagingKind()
* @generated
* @ordered
*/
protected static final String PACKAGING_KIND_EDEFAULT = null;
/**
* The cached value of the '{@link #getPackagingKind() <em>Packaging Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPackagingKind()
* @generated
* @ordered
*/
protected String packagingKind = PACKAGING_KIND_EDEFAULT;
/**
* The cached value of the '{@link #getContent() <em>Content</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContent()
* @generated
* @ordered
*/
protected EList content;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PackageImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return SmartGenPackage.Literals.PACKAGE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPackagingKind() {
return packagingKind;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPackagingKind(String newPackagingKind) {
String oldPackagingKind = packagingKind;
packagingKind = newPackagingKind;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmartGenPackage.PACKAGE__PACKAGING_KIND, oldPackagingKind, packagingKind));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getContent() {
if (content == null) {
content = new EObjectContainmentEList(File.class, this, SmartGenPackage.PACKAGE__CONTENT);
}
return content;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SmartGenPackage.PACKAGE__CONTENT:
return ((InternalEList)getContent()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SmartGenPackage.PACKAGE__PACKAGING_KIND:
return getPackagingKind();
case SmartGenPackage.PACKAGE__CONTENT:
return getContent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SmartGenPackage.PACKAGE__PACKAGING_KIND:
setPackagingKind((String)newValue);
return;
case SmartGenPackage.PACKAGE__CONTENT:
getContent().clear();
getContent().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case SmartGenPackage.PACKAGE__PACKAGING_KIND:
setPackagingKind(PACKAGING_KIND_EDEFAULT);
return;
case SmartGenPackage.PACKAGE__CONTENT:
getContent().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case SmartGenPackage.PACKAGE__PACKAGING_KIND:
return PACKAGING_KIND_EDEFAULT == null ? packagingKind != null : !PACKAGING_KIND_EDEFAULT.equals(packagingKind);
case SmartGenPackage.PACKAGE__CONTENT:
return content != null && !content.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (packagingKind: ");
result.append(packagingKind);
result.append(')');
return result.toString();
}
} //PackageImpl