blob: a164e6e7977397ba142919b806d9d753b97c906e [file] [log] [blame]
/**
*/
package org.eclipse.papyrus.bpmn.BPMNProfile.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage;
import org.eclipse.papyrus.bpmn.BPMNProfile.ParticipantMultiplicity;
import org.eclipse.uml2.uml.MultiplicityElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Participant Multiplicity</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantMultiplicityImpl#getBase_MultiplicityElement <em>Base Multiplicity Element</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantMultiplicityImpl#getMinimum <em>Minimum</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantMultiplicityImpl#getMaximum <em>Maximum</em>}</li>
* </ul>
*
* @generated
*/
public class ParticipantMultiplicityImpl extends BaseElementImpl implements ParticipantMultiplicity {
/**
* The cached value of the '{@link #getBase_MultiplicityElement() <em>Base Multiplicity Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_MultiplicityElement()
* @generated
* @ordered
*/
protected MultiplicityElement base_MultiplicityElement;
/**
* The default value of the '{@link #getMinimum() <em>Minimum</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMinimum()
* @generated
* @ordered
*/
protected static final int MINIMUM_EDEFAULT = 0;
/**
* The cached value of the '{@link #getMinimum() <em>Minimum</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMinimum()
* @generated
* @ordered
*/
protected int minimum = MINIMUM_EDEFAULT;
/**
* The default value of the '{@link #getMaximum() <em>Maximum</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMaximum()
* @generated
* @ordered
*/
protected static final int MAXIMUM_EDEFAULT = 0;
/**
* The cached value of the '{@link #getMaximum() <em>Maximum</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMaximum()
* @generated
* @ordered
*/
protected int maximum = MAXIMUM_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ParticipantMultiplicityImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getParticipantMultiplicity();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MultiplicityElement getBase_MultiplicityElement() {
if (base_MultiplicityElement != null && base_MultiplicityElement.eIsProxy()) {
InternalEObject oldBase_MultiplicityElement = (InternalEObject)base_MultiplicityElement;
base_MultiplicityElement = (MultiplicityElement)eResolveProxy(oldBase_MultiplicityElement);
if (base_MultiplicityElement != oldBase_MultiplicityElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT, oldBase_MultiplicityElement, base_MultiplicityElement));
}
}
return base_MultiplicityElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MultiplicityElement basicGetBase_MultiplicityElement() {
return base_MultiplicityElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_MultiplicityElement(MultiplicityElement newBase_MultiplicityElement) {
MultiplicityElement oldBase_MultiplicityElement = base_MultiplicityElement;
base_MultiplicityElement = newBase_MultiplicityElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT, oldBase_MultiplicityElement, base_MultiplicityElement));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getMinimum() {
return minimum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMinimum(int newMinimum) {
int oldMinimum = minimum;
minimum = newMinimum;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MINIMUM, oldMinimum, minimum));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getMaximum() {
return maximum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMaximum(int newMaximum) {
int oldMaximum = maximum;
maximum = newMaximum;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MAXIMUM, oldMaximum, maximum));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT:
if (resolve) return getBase_MultiplicityElement();
return basicGetBase_MultiplicityElement();
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MINIMUM:
return getMinimum();
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MAXIMUM:
return getMaximum();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT:
setBase_MultiplicityElement((MultiplicityElement)newValue);
return;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MINIMUM:
setMinimum((Integer)newValue);
return;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MAXIMUM:
setMaximum((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT:
setBase_MultiplicityElement((MultiplicityElement)null);
return;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MINIMUM:
setMinimum(MINIMUM_EDEFAULT);
return;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MAXIMUM:
setMaximum(MAXIMUM_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__BASE_MULTIPLICITY_ELEMENT:
return base_MultiplicityElement != null;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MINIMUM:
return minimum != MINIMUM_EDEFAULT;
case BPMNProfilePackage.PARTICIPANT_MULTIPLICITY__MAXIMUM:
return maximum != MAXIMUM_EDEFAULT;
}
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(" (minimum: ");
result.append(minimum);
result.append(", maximum: ");
result.append(maximum);
result.append(')');
return result.toString();
}
} //ParticipantMultiplicityImpl