/** * 2014 Urs Zeidler */ package de.urszeidler.eclipse.shr5.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.MinimalEObjectImpl; import de.urszeidler.eclipse.shr5.Localization; import de.urszeidler.eclipse.shr5.Shr5Package; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Localization</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link de.urszeidler.eclipse.shr5.impl.LocalizationImpl#getLocal <em>Local</em>}</li> * <li>{@link de.urszeidler.eclipse.shr5.impl.LocalizationImpl#getName <em>Name</em>}</li> * <li>{@link de.urszeidler.eclipse.shr5.impl.LocalizationImpl#getPage <em>Page</em>}</li> * </ul> * </p> * * @generated */ public class LocalizationImpl extends MinimalEObjectImpl.Container implements Localization { /** * The default value of the '{@link #getLocal() <em>Local</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocal() * @generated * @ordered */ protected static final String LOCAL_EDEFAULT = null; /** * The cached value of the '{@link #getLocal() <em>Local</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocal() * @generated * @ordered */ protected String local = LOCAL_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 #getPage() <em>Page</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPage() * @generated * @ordered */ protected static final int PAGE_EDEFAULT = 0; /** * The cached value of the '{@link #getPage() <em>Page</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPage() * @generated * @ordered */ protected int page = PAGE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected LocalizationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Shr5Package.Literals.LOCALIZATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLocal() { return local; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLocal(String newLocal) { String oldLocal = local; local = newLocal; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.LOCALIZATION__LOCAL, oldLocal, local)); } /** * <!-- 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.LOCALIZATION__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getPage() { return page; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setPage(int newPage) { int oldPage = page; page = newPage; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.LOCALIZATION__PAGE, oldPage, page)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Shr5Package.LOCALIZATION__LOCAL: return getLocal(); case Shr5Package.LOCALIZATION__NAME: return getName(); case Shr5Package.LOCALIZATION__PAGE: return getPage(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Shr5Package.LOCALIZATION__LOCAL: setLocal((String)newValue); return; case Shr5Package.LOCALIZATION__NAME: setName((String)newValue); return; case Shr5Package.LOCALIZATION__PAGE: setPage((Integer)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Shr5Package.LOCALIZATION__LOCAL: setLocal(LOCAL_EDEFAULT); return; case Shr5Package.LOCALIZATION__NAME: setName(NAME_EDEFAULT); return; case Shr5Package.LOCALIZATION__PAGE: setPage(PAGE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Shr5Package.LOCALIZATION__LOCAL: return LOCAL_EDEFAULT == null ? local != null : !LOCAL_EDEFAULT.equals(local); case Shr5Package.LOCALIZATION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case Shr5Package.LOCALIZATION__PAGE: return page != PAGE_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(" (local: "); result.append(local); result.append(", name: "); result.append(name); result.append(", page: "); result.append(page); result.append(')'); return result.toString(); } } //LocalizationImpl