blob: 5eefc3184a7a5fff7afbf7b58a155caf92775761 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2008-2014 See4sys, itemis and others.
* 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:
* See4sys - Initial API and implementation
* itemis - Enhancements and maintenance
*
* </copyright>
*/
package org.eclipse.sphinx.examples.hummingbird20.common.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.sphinx.examples.hummingbird20.Hummingbird20EObjectImpl;
import org.eclipse.sphinx.examples.hummingbird20.common.Common20Package;
import org.eclipse.sphinx.examples.hummingbird20.common.LanguageCultureName;
import org.eclipse.sphinx.examples.hummingbird20.common.Translation;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Translation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.sphinx.examples.hummingbird20.common.impl.TranslationImpl#getLanguage <em>Language</em>}</li>
* <li>{@link org.eclipse.sphinx.examples.hummingbird20.common.impl.TranslationImpl#getResourceURI <em>Resource URI</em>}</li>
* </ul>
*
* @generated
*/
public class TranslationImpl extends Hummingbird20EObjectImpl implements Translation {
/**
* The default value of the '{@link #getLanguage() <em>Language</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLanguage()
* @generated
* @ordered
*/
protected static final LanguageCultureName LANGUAGE_EDEFAULT = LanguageCultureName.EN_US;
/**
* The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLanguage()
* @generated
* @ordered
*/
protected LanguageCultureName language = LANGUAGE_EDEFAULT;
/**
* The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResourceURI()
* @generated
* @ordered
*/
protected static final URI RESOURCE_URI_EDEFAULT = null;
/**
* The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResourceURI()
* @generated
* @ordered
*/
protected URI resourceURI = RESOURCE_URI_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TranslationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Common20Package.Literals.TRANSLATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LanguageCultureName getLanguage() {
return language;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLanguage(LanguageCultureName newLanguage) {
LanguageCultureName oldLanguage = language;
language = newLanguage == null ? LANGUAGE_EDEFAULT : newLanguage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Common20Package.TRANSLATION__LANGUAGE, oldLanguage, language));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public URI getResourceURI() {
return resourceURI;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResourceURI(URI newResourceURI) {
URI oldResourceURI = resourceURI;
resourceURI = newResourceURI;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Common20Package.TRANSLATION__RESOURCE_URI, oldResourceURI, resourceURI));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Common20Package.TRANSLATION__LANGUAGE:
return getLanguage();
case Common20Package.TRANSLATION__RESOURCE_URI:
return getResourceURI();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Common20Package.TRANSLATION__LANGUAGE:
setLanguage((LanguageCultureName)newValue);
return;
case Common20Package.TRANSLATION__RESOURCE_URI:
setResourceURI((URI)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Common20Package.TRANSLATION__LANGUAGE:
setLanguage(LANGUAGE_EDEFAULT);
return;
case Common20Package.TRANSLATION__RESOURCE_URI:
setResourceURI(RESOURCE_URI_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Common20Package.TRANSLATION__LANGUAGE:
return language != LANGUAGE_EDEFAULT;
case Common20Package.TRANSLATION__RESOURCE_URI:
return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI);
}
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(" (language: "); //$NON-NLS-1$
result.append(language);
result.append(", resourceURI: "); //$NON-NLS-1$
result.append(resourceURI);
result.append(')');
return result.toString();
}
} //TranslationImpl