/**
*/
package de.urszeidler.eclipse.shr5.impl;
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.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import de.urszeidler.eclipse.shr5.Identifiable;
import de.urszeidler.eclipse.shr5.Localization;
import de.urszeidler.eclipse.shr5.Shr5Package;
import de.urszeidler.eclipse.shr5.ShrList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Shr List</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getBeschreibung <em>Beschreibung</em>}</li>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getImage <em>Image</em>}</li>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getName <em>Name</em>}</li>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getParentId <em>Parent Id</em>}</li>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getLocalizations <em>Localizations</em>}</li>
* <li>{@link de.urszeidler.eclipse.shr5.impl.ShrListImpl#getEntries <em>Entries</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ShrListImpl extends MinimalEObjectImpl.Container implements ShrList {
/**
* The default value of the '{@link #getBeschreibung() <em>Beschreibung</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBeschreibung()
* @generated
* @ordered
*/
protected static final String BESCHREIBUNG_EDEFAULT = null;
/**
* The cached value of the '{@link #getBeschreibung() <em>Beschreibung</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBeschreibung()
* @generated
* @ordered
*/
protected String beschreibung = BESCHREIBUNG_EDEFAULT;
/**
* The default value of the '{@link #getImage() <em>Image</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImage()
* @generated
* @ordered
*/
protected static final String IMAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getImage() <em>Image</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImage()
* @generated
* @ordered
*/
protected String image = IMAGE_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getParentId() <em>Parent Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParentId()
* @generated
* @ordered
*/
protected static final String PARENT_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getParentId() <em>Parent Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParentId()
* @generated
* @ordered
*/
protected String parentId = PARENT_ID_EDEFAULT;
/**
* The cached value of the '{@link #getLocalizations() <em>Localizations</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocalizations()
* @generated
* @ordered
*/
protected EList<Localization> localizations;
/**
* The cached value of the '{@link #getEntries() <em>Entries</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntries()
* @generated
* @ordered
*/
protected EList<EObject> entries;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ShrListImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Shr5Package.Literals.SHR_LIST;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.SHR_LIST__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getParentId() {
return parentId;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParentId(String newParentId) {
String oldParentId = parentId;
parentId = newParentId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.SHR_LIST__PARENT_ID, oldParentId, parentId));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Localization> getLocalizations() {
if (localizations == null) {
localizations = new EObjectContainmentEList<Localization>(Localization.class, this, Shr5Package.SHR_LIST__LOCALIZATIONS);
}
return localizations;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getBeschreibung() {
return beschreibung;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBeschreibung(String newBeschreibung) {
String oldBeschreibung = beschreibung;
beschreibung = newBeschreibung;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.SHR_LIST__BESCHREIBUNG, oldBeschreibung, beschreibung));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getImage() {
return image;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setImage(String newImage) {
String oldImage = image;
image = newImage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.SHR_LIST__IMAGE, oldImage, image));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<EObject> getEntries() {
if (entries == null) {
entries = new EObjectContainmentEList<EObject>(EObject.class, this, Shr5Package.SHR_LIST__ENTRIES);
}
return entries;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Shr5Package.SHR_LIST__LOCALIZATIONS:
return ((InternalEList<?>)getLocalizations()).basicRemove(otherEnd, msgs);
case Shr5Package.SHR_LIST__ENTRIES:
return ((InternalEList<?>)getEntries()).basicRemove(otherEnd, 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 Shr5Package.SHR_LIST__BESCHREIBUNG:
return getBeschreibung();
case Shr5Package.SHR_LIST__IMAGE:
return getImage();
case Shr5Package.SHR_LIST__NAME:
return getName();
case Shr5Package.SHR_LIST__PARENT_ID:
return getParentId();
case Shr5Package.SHR_LIST__LOCALIZATIONS:
return getLocalizations();
case Shr5Package.SHR_LIST__ENTRIES:
return getEntries();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Shr5Package.SHR_LIST__BESCHREIBUNG:
setBeschreibung((String)newValue);
return;
case Shr5Package.SHR_LIST__IMAGE:
setImage((String)newValue);
return;
case Shr5Package.SHR_LIST__NAME:
setName((String)newValue);
return;
case Shr5Package.SHR_LIST__PARENT_ID:
setParentId((String)newValue);
return;
case Shr5Package.SHR_LIST__LOCALIZATIONS:
getLocalizations().clear();
getLocalizations().addAll((Collection<? extends Localization>)newValue);
return;
case Shr5Package.SHR_LIST__ENTRIES:
getEntries().clear();
getEntries().addAll((Collection<? extends EObject>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Shr5Package.SHR_LIST__BESCHREIBUNG:
setBeschreibung(BESCHREIBUNG_EDEFAULT);
return;
case Shr5Package.SHR_LIST__IMAGE:
setImage(IMAGE_EDEFAULT);
return;
case Shr5Package.SHR_LIST__NAME:
setName(NAME_EDEFAULT);
return;
case Shr5Package.SHR_LIST__PARENT_ID:
setParentId(PARENT_ID_EDEFAULT);
return;
case Shr5Package.SHR_LIST__LOCALIZATIONS:
getLocalizations().clear();
return;
case Shr5Package.SHR_LIST__ENTRIES:
getEntries().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Shr5Package.SHR_LIST__BESCHREIBUNG:
return BESCHREIBUNG_EDEFAULT == null ? beschreibung != null : !BESCHREIBUNG_EDEFAULT.equals(beschreibung);
case Shr5Package.SHR_LIST__IMAGE:
return IMAGE_EDEFAULT == null ? image != null : !IMAGE_EDEFAULT.equals(image);
case Shr5Package.SHR_LIST__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case Shr5Package.SHR_LIST__PARENT_ID:
return PARENT_ID_EDEFAULT == null ? parentId != null : !PARENT_ID_EDEFAULT.equals(parentId);
case Shr5Package.SHR_LIST__LOCALIZATIONS:
return localizations != null && !localizations.isEmpty();
case Shr5Package.SHR_LIST__ENTRIES:
return entries != null && !entries.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
if (baseClass == Identifiable.class) {
switch (derivedFeatureID) {
case Shr5Package.SHR_LIST__PARENT_ID: return Shr5Package.IDENTIFIABLE__PARENT_ID;
case Shr5Package.SHR_LIST__LOCALIZATIONS: return Shr5Package.IDENTIFIABLE__LOCALIZATIONS;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
if (baseClass == Identifiable.class) {
switch (baseFeatureID) {
case Shr5Package.IDENTIFIABLE__PARENT_ID: return Shr5Package.SHR_LIST__PARENT_ID;
case Shr5Package.IDENTIFIABLE__LOCALIZATIONS: return Shr5Package.SHR_LIST__LOCALIZATIONS;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (beschreibung: ");
result.append(beschreibung);
result.append(", image: ");
result.append(image);
result.append(", name: ");
result.append(name);
result.append(", parentId: ");
result.append(parentId);
result.append(')');
return result.toString();
}
} //ShrListImpl