/* * Copyright 2015 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** */ package bpsim.impl; import bpsim.BpsimPackage; import bpsim.Calendar; import bpsim.ElementParameters; import bpsim.ElementParametersType; import bpsim.Scenario; import bpsim.ScenarioParameters; import bpsim.ScenarioParametersType; import bpsim.VendorExtension; 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; /** * * An implementation of the model object 'Scenario'. * *

* The following features are implemented: *

*

* * @generated */ public class ScenarioImpl extends EObjectImpl implements Scenario { /** * The cached value of the '{@link #getScenarioParameters() Scenario Parameters}' containment reference. * * * @see #getScenarioParameters() * @generated * @ordered */ protected ScenarioParameters scenarioParameters; /** * The cached value of the '{@link #getElementParameters() Element Parameters}' containment reference list. * * * @see #getElementParameters() * @generated * @ordered */ protected EList elementParameters; /** * The cached value of the '{@link #getCalendar() Calendar}' containment reference list. * * * @see #getCalendar() * @generated * @ordered */ protected EList calendar; /** * The cached value of the '{@link #getVendorExtension() Vendor Extension}' containment reference list. * * * @see #getVendorExtension() * @generated * @ordered */ protected EList vendorExtension; /** * The default value of the '{@link #getAuthor() Author}' attribute. * * * @see #getAuthor() * @generated * @ordered */ protected static final String AUTHOR_EDEFAULT = null; /** * The cached value of the '{@link #getAuthor() Author}' attribute. * * * @see #getAuthor() * @generated * @ordered */ protected String author = AUTHOR_EDEFAULT; /** * The default value of the '{@link #getCreated() Created}' attribute. * * * @see #getCreated() * @generated * @ordered */ protected static final Object CREATED_EDEFAULT = null; /** * The cached value of the '{@link #getCreated() Created}' attribute. * * * @see #getCreated() * @generated * @ordered */ protected Object created = CREATED_EDEFAULT; /** * The default value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The default value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected static final String ID_EDEFAULT = null; /** * The cached value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected String id = ID_EDEFAULT; /** * The default value of the '{@link #getInherits() Inherits}' attribute. * * * @see #getInherits() * @generated * @ordered */ protected static final String INHERITS_EDEFAULT = null; /** * The cached value of the '{@link #getInherits() Inherits}' attribute. * * * @see #getInherits() * @generated * @ordered */ protected String inherits = INHERITS_EDEFAULT; /** * The default value of the '{@link #getModified() Modified}' attribute. * * * @see #getModified() * @generated * @ordered */ protected static final Object MODIFIED_EDEFAULT = null; /** * The cached value of the '{@link #getModified() Modified}' attribute. * * * @see #getModified() * @generated * @ordered */ protected Object modified = MODIFIED_EDEFAULT; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getResult() Result}' attribute. * * * @see #getResult() * @generated * @ordered */ protected static final String RESULT_EDEFAULT = null; /** * The cached value of the '{@link #getResult() Result}' attribute. * * * @see #getResult() * @generated * @ordered */ protected String result = RESULT_EDEFAULT; /** * The default value of the '{@link #getVendor() Vendor}' attribute. * * * @see #getVendor() * @generated * @ordered */ protected static final String VENDOR_EDEFAULT = null; /** * The cached value of the '{@link #getVendor() Vendor}' attribute. * * * @see #getVendor() * @generated * @ordered */ protected String vendor = VENDOR_EDEFAULT; /** * The default value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected static final String VERSION_EDEFAULT = null; /** * The cached value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected String version = VERSION_EDEFAULT; /** * * * @generated */ protected ScenarioImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BpsimPackage.Literals.SCENARIO; } /** * * * @generated */ public ScenarioParameters getScenarioParameters() { return scenarioParameters; } /** * * * @generated */ public NotificationChain basicSetScenarioParameters(ScenarioParameters newScenarioParameters, NotificationChain msgs) { ScenarioParameters oldScenarioParameters = scenarioParameters; scenarioParameters = newScenarioParameters; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, oldScenarioParameters, newScenarioParameters); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setScenarioParameters(ScenarioParameters newScenarioParameters) { if (newScenarioParameters != scenarioParameters) { NotificationChain msgs = null; if (scenarioParameters != null) msgs = ((InternalEObject)scenarioParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs); if (newScenarioParameters != null) msgs = ((InternalEObject)newScenarioParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs); msgs = basicSetScenarioParameters(newScenarioParameters, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, newScenarioParameters, newScenarioParameters)); } /** * * * @generated */ public EList getElementParameters() { if (elementParameters == null) { elementParameters = new EObjectContainmentEList(ElementParameters.class, this, BpsimPackage.SCENARIO__ELEMENT_PARAMETERS); } return elementParameters; } /** * * * @generated */ public EList getCalendar() { if (calendar == null) { calendar = new EObjectContainmentEList(Calendar.class, this, BpsimPackage.SCENARIO__CALENDAR); } return calendar; } /** * * * @generated */ public EList getVendorExtension() { if (vendorExtension == null) { vendorExtension = new EObjectContainmentEList(VendorExtension.class, this, BpsimPackage.SCENARIO__VENDOR_EXTENSION); } return vendorExtension; } /** * * * @generated */ public String getAuthor() { return author; } /** * * * @generated */ public void setAuthor(String newAuthor) { String oldAuthor = author; author = newAuthor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__AUTHOR, oldAuthor, author)); } /** * * * @generated */ public Object getCreated() { return created; } /** * * * @generated */ public void setCreated(Object newCreated) { Object oldCreated = created; created = newCreated; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__CREATED, oldCreated, created)); } /** * * * @generated */ public String getDescription() { return description; } /** * * * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__DESCRIPTION, oldDescription, description)); } /** * * * @generated */ public String getId() { return id; } /** * * * @generated */ public void setId(String newId) { String oldId = id; id = newId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__ID, oldId, id)); } /** * * * @generated */ public String getInherits() { return inherits; } /** * * * @generated */ public void setInherits(String newInherits) { String oldInherits = inherits; inherits = newInherits; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__INHERITS, oldInherits, inherits)); } /** * * * @generated */ public Object getModified() { return modified; } /** * * * @generated */ public void setModified(Object newModified) { Object oldModified = modified; modified = newModified; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__MODIFIED, oldModified, modified)); } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__NAME, oldName, name)); } /** * * * @generated */ public String getResult() { return result; } /** * * * @generated */ public void setResult(String newResult) { String oldResult = result; result = newResult; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__RESULT, oldResult, result)); } /** * * * @generated */ public String getVendor() { return vendor; } /** * * * @generated */ public void setVendor(String newVendor) { String oldVendor = vendor; vendor = newVendor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VENDOR, oldVendor, vendor)); } /** * * * @generated */ public String getVersion() { return version; } /** * * * @generated */ public void setVersion(String newVersion) { String oldVersion = version; version = newVersion; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VERSION, oldVersion, version)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: return basicSetScenarioParameters(null, msgs); case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: return ((InternalEList)getElementParameters()).basicRemove(otherEnd, msgs); case BpsimPackage.SCENARIO__CALENDAR: return ((InternalEList)getCalendar()).basicRemove(otherEnd, msgs); case BpsimPackage.SCENARIO__VENDOR_EXTENSION: return ((InternalEList)getVendorExtension()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: return getScenarioParameters(); case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: return getElementParameters(); case BpsimPackage.SCENARIO__CALENDAR: return getCalendar(); case BpsimPackage.SCENARIO__VENDOR_EXTENSION: return getVendorExtension(); case BpsimPackage.SCENARIO__AUTHOR: return getAuthor(); case BpsimPackage.SCENARIO__CREATED: return getCreated(); case BpsimPackage.SCENARIO__DESCRIPTION: return getDescription(); case BpsimPackage.SCENARIO__ID: return getId(); case BpsimPackage.SCENARIO__INHERITS: return getInherits(); case BpsimPackage.SCENARIO__MODIFIED: return getModified(); case BpsimPackage.SCENARIO__NAME: return getName(); case BpsimPackage.SCENARIO__RESULT: return getResult(); case BpsimPackage.SCENARIO__VENDOR: return getVendor(); case BpsimPackage.SCENARIO__VERSION: return getVersion(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: setScenarioParameters((ScenarioParameters)newValue); return; case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: getElementParameters().clear(); getElementParameters().addAll((Collection)newValue); return; case BpsimPackage.SCENARIO__CALENDAR: getCalendar().clear(); getCalendar().addAll((Collection)newValue); return; case BpsimPackage.SCENARIO__VENDOR_EXTENSION: getVendorExtension().clear(); getVendorExtension().addAll((Collection)newValue); return; case BpsimPackage.SCENARIO__AUTHOR: setAuthor((String)newValue); return; case BpsimPackage.SCENARIO__CREATED: setCreated(newValue); return; case BpsimPackage.SCENARIO__DESCRIPTION: setDescription((String)newValue); return; case BpsimPackage.SCENARIO__ID: setId((String)newValue); return; case BpsimPackage.SCENARIO__INHERITS: setInherits((String)newValue); return; case BpsimPackage.SCENARIO__MODIFIED: setModified(newValue); return; case BpsimPackage.SCENARIO__NAME: setName((String)newValue); return; case BpsimPackage.SCENARIO__RESULT: setResult((String)newValue); return; case BpsimPackage.SCENARIO__VENDOR: setVendor((String)newValue); return; case BpsimPackage.SCENARIO__VERSION: setVersion((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: setScenarioParameters((ScenarioParameters)null); return; case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: getElementParameters().clear(); return; case BpsimPackage.SCENARIO__CALENDAR: getCalendar().clear(); return; case BpsimPackage.SCENARIO__VENDOR_EXTENSION: getVendorExtension().clear(); return; case BpsimPackage.SCENARIO__AUTHOR: setAuthor(AUTHOR_EDEFAULT); return; case BpsimPackage.SCENARIO__CREATED: setCreated(CREATED_EDEFAULT); return; case BpsimPackage.SCENARIO__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case BpsimPackage.SCENARIO__ID: setId(ID_EDEFAULT); return; case BpsimPackage.SCENARIO__INHERITS: setInherits(INHERITS_EDEFAULT); return; case BpsimPackage.SCENARIO__MODIFIED: setModified(MODIFIED_EDEFAULT); return; case BpsimPackage.SCENARIO__NAME: setName(NAME_EDEFAULT); return; case BpsimPackage.SCENARIO__RESULT: setResult(RESULT_EDEFAULT); return; case BpsimPackage.SCENARIO__VENDOR: setVendor(VENDOR_EDEFAULT); return; case BpsimPackage.SCENARIO__VERSION: setVersion(VERSION_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: return scenarioParameters != null; case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: return elementParameters != null && !elementParameters.isEmpty(); case BpsimPackage.SCENARIO__CALENDAR: return calendar != null && !calendar.isEmpty(); case BpsimPackage.SCENARIO__VENDOR_EXTENSION: return vendorExtension != null && !vendorExtension.isEmpty(); case BpsimPackage.SCENARIO__AUTHOR: return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author); case BpsimPackage.SCENARIO__CREATED: return CREATED_EDEFAULT == null ? created != null : !CREATED_EDEFAULT.equals(created); case BpsimPackage.SCENARIO__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case BpsimPackage.SCENARIO__ID: return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); case BpsimPackage.SCENARIO__INHERITS: return INHERITS_EDEFAULT == null ? inherits != null : !INHERITS_EDEFAULT.equals(inherits); case BpsimPackage.SCENARIO__MODIFIED: return MODIFIED_EDEFAULT == null ? modified != null : !MODIFIED_EDEFAULT.equals(modified); case BpsimPackage.SCENARIO__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case BpsimPackage.SCENARIO__RESULT: return RESULT_EDEFAULT == null ? result != null : !RESULT_EDEFAULT.equals(result); case BpsimPackage.SCENARIO__VENDOR: return VENDOR_EDEFAULT == null ? vendor != null : !VENDOR_EDEFAULT.equals(vendor); case BpsimPackage.SCENARIO__VERSION: return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (author: "); result.append(author); result.append(", created: "); result.append(created); result.append(", description: "); result.append(description); result.append(", id: "); result.append(id); result.append(", inherits: "); result.append(inherits); result.append(", modified: "); result.append(modified); result.append(", name: "); result.append(name); result.append(", result: "); result.append(result); result.append(", vendor: "); result.append(vendor); result.append(", version: "); result.append(version); result.append(')'); return result.toString(); } } //ScenarioImpl