/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id$ */ package org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.BasicFeatureMap; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.InternalEList; import org.oasisopen.names.tc.opendocument.xmlns.datastyle.CurrencySymbolType; import org.oasisopen.names.tc.opendocument.xmlns.datastyle.DatastylePackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Currency Symbol Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.CurrencySymbolTypeImpl#getMixed <em>Mixed</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.CurrencySymbolTypeImpl#getCountry <em>Country</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.CurrencySymbolTypeImpl#getLanguage <em>Language</em>}</li> * </ul> * </p> * * @generated */ public class CurrencySymbolTypeImpl extends EObjectImpl implements CurrencySymbolType { /** * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMixed() * @generated * @ordered */ protected FeatureMap mixed; /** * The default value of the '{@link #getCountry() <em>Country</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCountry() * @generated * @ordered */ protected static final String COUNTRY_EDEFAULT = null; /** * The cached value of the '{@link #getCountry() <em>Country</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCountry() * @generated * @ordered */ protected String country = COUNTRY_EDEFAULT; /** * The default value of the '{@link #getLanguage() <em>Language</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLanguage() * @generated * @ordered */ protected static final String LANGUAGE_EDEFAULT = null; /** * The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLanguage() * @generated * @ordered */ protected String language = LANGUAGE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CurrencySymbolTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DatastylePackage.Literals.CURRENCY_SYMBOL_TYPE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public FeatureMap getMixed() { if (mixed == null) { mixed = new BasicFeatureMap(this, DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED); } return mixed; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getCountry() { return country; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setCountry(String newCountry) { String oldCountry = country; country = newCountry; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.CURRENCY_SYMBOL_TYPE__COUNTRY, oldCountry, country)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLanguage() { return language; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLanguage(String newLanguage) { String oldLanguage = language; language = newLanguage; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.CURRENCY_SYMBOL_TYPE__LANGUAGE, oldLanguage, language)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED: return ((InternalEList<?>)getMixed()).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 DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED: if (coreType) return getMixed(); return ((FeatureMap.Internal)getMixed()).getWrapper(); case DatastylePackage.CURRENCY_SYMBOL_TYPE__COUNTRY: return getCountry(); case DatastylePackage.CURRENCY_SYMBOL_TYPE__LANGUAGE: return getLanguage(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED: ((FeatureMap.Internal)getMixed()).set(newValue); return; case DatastylePackage.CURRENCY_SYMBOL_TYPE__COUNTRY: setCountry((String)newValue); return; case DatastylePackage.CURRENCY_SYMBOL_TYPE__LANGUAGE: setLanguage((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED: getMixed().clear(); return; case DatastylePackage.CURRENCY_SYMBOL_TYPE__COUNTRY: setCountry(COUNTRY_EDEFAULT); return; case DatastylePackage.CURRENCY_SYMBOL_TYPE__LANGUAGE: setLanguage(LANGUAGE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DatastylePackage.CURRENCY_SYMBOL_TYPE__MIXED: return mixed != null && !mixed.isEmpty(); case DatastylePackage.CURRENCY_SYMBOL_TYPE__COUNTRY: return COUNTRY_EDEFAULT == null ? country != null : !COUNTRY_EDEFAULT.equals(country); case DatastylePackage.CURRENCY_SYMBOL_TYPE__LANGUAGE: return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language); } 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(" (mixed: "); result.append(mixed); result.append(", country: "); result.append(country); result.append(", language: "); result.append(language); result.append(')'); return result.toString(); } } //CurrencySymbolTypeImpl