/** * <copyright> * * Copyright (c) 2010 SAP AG. * 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 * * Contributors: * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation * * </copyright> */ package org.eclipse.bpmn2.impl; import org.eclipse.bpmn2.Bpmn2Package; import org.eclipse.bpmn2.ParticipantMultiplicity; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Participant Multiplicity</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl#getMaximum <em>Maximum</em>}</li> * <li>{@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl#getMinimum <em>Minimum</em>}</li> * </ul> * </p> * * @generated */ public class ParticipantMultiplicityImpl extends EObjectImpl implements ParticipantMultiplicity { /** * 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 = 1; /** * 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; /** * 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; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ParticipantMultiplicityImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.Literals.PARTICIPANT_MULTIPLICITY; } /** * <!-- 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, Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM, oldMaximum, maximum)); } /** * <!-- 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, Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM, oldMinimum, minimum)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: return getMaximum(); case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: return getMinimum(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: setMaximum((Integer) newValue); return; case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: setMinimum((Integer) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: setMaximum(MAXIMUM_EDEFAULT); return; case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: setMinimum(MINIMUM_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: return maximum != MAXIMUM_EDEFAULT; case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: return minimum != MINIMUM_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(" (maximum: "); result.append(maximum); result.append(", minimum: "); result.append(minimum); result.append(')'); return result.toString(); } } //ParticipantMultiplicityImpl