| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * 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.BooleanParameterType; |
| import bpsim.BpsimPackage; |
| import com.google.gwt.user.client.rpc.GwtTransient; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Boolean Parameter Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link bpsim.impl.BooleanParameterTypeImpl#isValue <em>Value</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BooleanParameterTypeImpl extends ConstantParameterImpl implements BooleanParameterType { |
| /** |
| * The default value of the '{@link #isValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean VALUE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isValue() |
| * @generated |
| * @ordered |
| */ |
| @GwtTransient |
| protected boolean value = VALUE_EDEFAULT; |
| |
| /** |
| * This is true if the Value attribute has been set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| @GwtTransient |
| protected boolean valueESet; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BooleanParameterTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BpsimPackage.Literals.BOOLEAN_PARAMETER_TYPE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setValue(boolean newValue) { |
| boolean oldValue = value; |
| value = newValue; |
| boolean oldValueESet = valueESet; |
| valueESet = true; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE, oldValue, value, !oldValueESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void unsetValue() { |
| boolean oldValue = value; |
| boolean oldValueESet = valueESet; |
| value = VALUE_EDEFAULT; |
| valueESet = false; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE, oldValue, VALUE_EDEFAULT, oldValueESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isSetValue() { |
| return valueESet; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: |
| return isValue(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: |
| setValue((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: |
| unsetValue(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: |
| return isSetValue(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (value: "); |
| if (valueESet) result.append(value); else result.append("<unset>"); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BooleanParameterTypeImpl |