| /** |
| */ |
| package org.eclipse.osee.framework.core.dsl.oseeDsl.impl; |
| |
| 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.MinimalEObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.Condition; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslPackage; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.XLogicOperator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>XArtifact Matcher</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osee.framework.core.dsl.oseeDsl.impl.XArtifactMatcherImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osee.framework.core.dsl.oseeDsl.impl.XArtifactMatcherImpl#getConditions <em>Conditions</em>}</li> |
| * <li>{@link org.eclipse.osee.framework.core.dsl.oseeDsl.impl.XArtifactMatcherImpl#getOperators <em>Operators</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class XArtifactMatcherImpl extends MinimalEObjectImpl.Container implements XArtifactMatcher |
| { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getConditions() <em>Conditions</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getConditions() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Condition> conditions; |
| |
| /** |
| * The cached value of the '{@link #getOperators() <em>Operators</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOperators() |
| * @generated |
| * @ordered |
| */ |
| protected EList<XLogicOperator> operators; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected XArtifactMatcherImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return OseeDslPackage.Literals.XARTIFACT_MATCHER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() |
| { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) |
| { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OseeDslPackage.XARTIFACT_MATCHER__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Condition> getConditions() |
| { |
| if (conditions == null) |
| { |
| conditions = new EObjectContainmentEList<Condition>(Condition.class, this, OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS); |
| } |
| return conditions; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<XLogicOperator> getOperators() |
| { |
| if (operators == null) |
| { |
| operators = new EDataTypeEList<XLogicOperator>(XLogicOperator.class, this, OseeDslPackage.XARTIFACT_MATCHER__OPERATORS); |
| } |
| return operators; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS: |
| return ((InternalEList<?>)getConditions()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.XARTIFACT_MATCHER__NAME: |
| return getName(); |
| case OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS: |
| return getConditions(); |
| case OseeDslPackage.XARTIFACT_MATCHER__OPERATORS: |
| return getOperators(); |
| } |
| 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 OseeDslPackage.XARTIFACT_MATCHER__NAME: |
| setName((String)newValue); |
| return; |
| case OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS: |
| getConditions().clear(); |
| getConditions().addAll((Collection<? extends Condition>)newValue); |
| return; |
| case OseeDslPackage.XARTIFACT_MATCHER__OPERATORS: |
| getOperators().clear(); |
| getOperators().addAll((Collection<? extends XLogicOperator>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.XARTIFACT_MATCHER__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS: |
| getConditions().clear(); |
| return; |
| case OseeDslPackage.XARTIFACT_MATCHER__OPERATORS: |
| getOperators().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.XARTIFACT_MATCHER__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case OseeDslPackage.XARTIFACT_MATCHER__CONDITIONS: |
| return conditions != null && !conditions.isEmpty(); |
| case OseeDslPackage.XARTIFACT_MATCHER__OPERATORS: |
| return operators != null && !operators.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(" (name: "); |
| result.append(name); |
| result.append(", operators: "); |
| result.append(operators); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //XArtifactMatcherImpl |