/******************************************************************************
* Copyright (c) 2007 g-Eclipse consortium
* 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
*
* Initial development of the original code was made for
* project g-Eclipse founded by European Union
* project number: FP6-IST-034327 http://www.geclipse.eu/
*
* Contributor(s):
* Mathias St�mpert
*
*****************************************************************************/
package eu.geclipse.jsdl.model.impl;
import eu.geclipse.jsdl.model.JobDefinitionType;
import eu.geclipse.jsdl.model.JobDescriptionType;
import eu.geclipse.jsdl.model.JsdlPackage;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Job Definition Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link eu.geclipse.jsdl.model.impl.JobDefinitionTypeImpl#getJobDescription <em>Job Description</em>}</li>
* <li>{@link eu.geclipse.jsdl.model.impl.JobDefinitionTypeImpl#getAny <em>Any</em>}</li>
* <li>{@link eu.geclipse.jsdl.model.impl.JobDefinitionTypeImpl#getId <em>Id</em>}</li>
* <li>{@link eu.geclipse.jsdl.model.impl.JobDefinitionTypeImpl#getAnyAttribute <em>Any Attribute</em>}</li>
* </ul>
* </p>
*
* @deprecated This class is deprecated. Substitute with the respective class in package eu.geclipse.jsdl.model.base.impl
* @generated
*/
public class JobDefinitionTypeImpl extends EObjectImpl implements JobDefinitionType
{
/**
* The cached value of the '{@link #getJobDescription() <em>Job Description</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getJobDescription()
* @generated
* @ordered
*/
protected JobDescriptionType jobDescription;
/**
* The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAny()
* @generated
* @ordered
*/
protected FeatureMap any;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAnyAttribute()
* @generated
* @ordered
*/
protected FeatureMap anyAttribute;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected JobDefinitionTypeImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass()
{
return JsdlPackage.Literals.JOB_DEFINITION_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JobDescriptionType getJobDescription()
{
return jobDescription;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetJobDescription(JobDescriptionType newJobDescription, NotificationChain msgs)
{
JobDescriptionType oldJobDescription = jobDescription;
jobDescription = newJobDescription;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION, oldJobDescription, newJobDescription);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setJobDescription(JobDescriptionType newJobDescription)
{
if (newJobDescription != jobDescription)
{
NotificationChain msgs = null;
if (jobDescription != null)
msgs = ((InternalEObject)jobDescription).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION, null, msgs);
if (newJobDescription != null)
msgs = ((InternalEObject)newJobDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION, null, msgs);
msgs = basicSetJobDescription(newJobDescription, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION, newJobDescription, newJobDescription));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getAny()
{
if (any == null)
{
any = new BasicFeatureMap(this, JsdlPackage.JOB_DEFINITION_TYPE__ANY);
}
return any;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId()
{
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId)
{
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JsdlPackage.JOB_DEFINITION_TYPE__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getAnyAttribute()
{
if (anyAttribute == null)
{
anyAttribute = new BasicFeatureMap(this, JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE);
}
return anyAttribute;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION:
return basicSetJobDescription(null, msgs);
case JsdlPackage.JOB_DEFINITION_TYPE__ANY:
return ((InternalEList)getAny()).basicRemove(otherEnd, msgs);
case JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE:
return ((InternalEList)getAnyAttribute()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION:
return getJobDescription();
case JsdlPackage.JOB_DEFINITION_TYPE__ANY:
if (coreType) return getAny();
return ((FeatureMap.Internal)getAny()).getWrapper();
case JsdlPackage.JOB_DEFINITION_TYPE__ID:
return getId();
case JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE:
if (coreType) return getAnyAttribute();
return ((FeatureMap.Internal)getAnyAttribute()).getWrapper();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION:
setJobDescription((JobDescriptionType)newValue);
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ANY:
((FeatureMap.Internal)getAny()).set(newValue);
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ID:
setId((String)newValue);
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE:
((FeatureMap.Internal)getAnyAttribute()).set(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID)
{
switch (featureID)
{
case JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION:
setJobDescription((JobDescriptionType)null);
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ANY:
getAny().clear();
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ID:
setId(ID_EDEFAULT);
return;
case JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE:
getAnyAttribute().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case JsdlPackage.JOB_DEFINITION_TYPE__JOB_DESCRIPTION:
return jobDescription != null;
case JsdlPackage.JOB_DEFINITION_TYPE__ANY:
return any != null && !any.isEmpty();
case JsdlPackage.JOB_DEFINITION_TYPE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case JsdlPackage.JOB_DEFINITION_TYPE__ANY_ATTRIBUTE:
return anyAttribute != null && !anyAttribute.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (any: ");
result.append(any);
result.append(", id: ");
result.append(id);
result.append(", anyAttribute: ");
result.append(anyAttribute);
result.append(')');
return result.toString();
}
} //JobDefinitionTypeImpl