/**
* <copyright>
* </copyright>
*
* $Id: TEMPLATETypeImpl.java 17131 2008-08-20 05:46:08Z nrousseau $
*/
package org.talend.designer.core.model.utils.emf.component.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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.talend.designer.core.model.utils.emf.component.ComponentPackage;
import org.talend.designer.core.model.utils.emf.component.LINKTOType;
import org.talend.designer.core.model.utils.emf.component.TEMPLATEType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>TEMPLATE Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.TEMPLATETypeImpl#getLINKTO <em>LINKTO</em>}</li>
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.TEMPLATETypeImpl#getCOMPONENT <em>COMPONENT</em>}</li>
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.TEMPLATETypeImpl#getNAME <em>NAME</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TEMPLATETypeImpl extends EObjectImpl implements TEMPLATEType {
/**
* The cached value of the '{@link #getLINKTO() <em>LINKTO</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLINKTO()
* @generated
* @ordered
*/
protected EList lINKTO;
/**
* The default value of the '{@link #getCOMPONENT() <em>COMPONENT</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCOMPONENT()
* @generated
* @ordered
*/
protected static final String COMPONENT_EDEFAULT = null;
/**
* The cached value of the '{@link #getCOMPONENT() <em>COMPONENT</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCOMPONENT()
* @generated
* @ordered
*/
protected String cOMPONENT = COMPONENT_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;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TEMPLATETypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ComponentPackage.Literals.TEMPLATE_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getLINKTO() {
if (lINKTO == null) {
lINKTO = new EObjectContainmentEList(LINKTOType.class, this, ComponentPackage.TEMPLATE_TYPE__LINKTO);
}
return lINKTO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getCOMPONENT() {
return cOMPONENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCOMPONENT(String newCOMPONENT) {
String oldCOMPONENT = cOMPONENT;
cOMPONENT = newCOMPONENT;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.TEMPLATE_TYPE__COMPONENT, oldCOMPONENT, cOMPONENT));
}
/**
* <!-- 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, ComponentPackage.TEMPLATE_TYPE__NAME, oldNAME, nAME));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ComponentPackage.TEMPLATE_TYPE__LINKTO:
return ((InternalEList)getLINKTO()).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 ComponentPackage.TEMPLATE_TYPE__LINKTO:
return getLINKTO();
case ComponentPackage.TEMPLATE_TYPE__COMPONENT:
return getCOMPONENT();
case ComponentPackage.TEMPLATE_TYPE__NAME:
return getNAME();
}
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 ComponentPackage.TEMPLATE_TYPE__LINKTO:
getLINKTO().clear();
getLINKTO().addAll((Collection)newValue);
return;
case ComponentPackage.TEMPLATE_TYPE__COMPONENT:
setCOMPONENT((String)newValue);
return;
case ComponentPackage.TEMPLATE_TYPE__NAME:
setNAME((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ComponentPackage.TEMPLATE_TYPE__LINKTO:
getLINKTO().clear();
return;
case ComponentPackage.TEMPLATE_TYPE__COMPONENT:
setCOMPONENT(COMPONENT_EDEFAULT);
return;
case ComponentPackage.TEMPLATE_TYPE__NAME:
setNAME(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComponentPackage.TEMPLATE_TYPE__LINKTO:
return lINKTO != null && !lINKTO.isEmpty();
case ComponentPackage.TEMPLATE_TYPE__COMPONENT:
return COMPONENT_EDEFAULT == null ? cOMPONENT != null : !COMPONENT_EDEFAULT.equals(cOMPONENT);
case ComponentPackage.TEMPLATE_TYPE__NAME:
return NAME_EDEFAULT == null ? nAME != null : !NAME_EDEFAULT.equals(nAME);
}
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(" (cOMPONENT: ");
result.append(cOMPONENT);
result.append(", nAME: ");
result.append(nAME);
result.append(')');
return result.toString();
}
} //TEMPLATETypeImpl