/** * <copyright> * </copyright> * * $Id$ */ package simulator.srl.impl; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; import simulator.srl.ResultsPackage; import simulator.srl.SimulationElement; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Simulation Element</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link simulator.srl.impl.SimulationElementImpl#getType <em>Type</em>}</li> * <li>{@link simulator.srl.impl.SimulationElementImpl#getParams <em>Params</em>}</li> * </ul> * </p> * * @generated */ public abstract class SimulationElementImpl extends EObjectImpl implements SimulationElement { /** * The default value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected static final String TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected String type = TYPE_EDEFAULT; /** * The cached value of the '{@link #getParams() <em>Params</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getParams() * @generated * @ordered */ protected EList<String> params; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SimulationElementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ResultsPackage.Literals.SIMULATION_ELEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(String newType) { String oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ResultsPackage.SIMULATION_ELEMENT__TYPE, oldType, type)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<String> getParams() { if (params == null) { params = new EDataTypeUniqueEList<String>(String.class, this, ResultsPackage.SIMULATION_ELEMENT__PARAMS); } return params; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ResultsPackage.SIMULATION_ELEMENT__TYPE: return getType(); case ResultsPackage.SIMULATION_ELEMENT__PARAMS: return getParams(); } 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 ResultsPackage.SIMULATION_ELEMENT__TYPE: setType((String)newValue); return; case ResultsPackage.SIMULATION_ELEMENT__PARAMS: getParams().clear(); getParams().addAll((Collection<? extends String>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ResultsPackage.SIMULATION_ELEMENT__TYPE: setType(TYPE_EDEFAULT); return; case ResultsPackage.SIMULATION_ELEMENT__PARAMS: getParams().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ResultsPackage.SIMULATION_ELEMENT__TYPE: return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); case ResultsPackage.SIMULATION_ELEMENT__PARAMS: return params != null && !params.isEmpty(); } 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(" (type: "); result.append(type); result.append(", params: "); result.append(params); result.append(')'); return result.toString(); } } //SimulationElementImpl