| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * All rights reserved. This program and the accompanying materials are |
| * made available under the terms of the Eclipse Public License v2.0 which |
| * accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.Bilinear; |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.Linear_layersPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Bilinear</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.BilinearImpl#getIn1_features <em>In1 features</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.BilinearImpl#getIn2_features <em>In2 features</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BilinearImpl extends Linear_layers_1Impl implements Bilinear { |
| /** |
| * The default value of the '{@link #getIn1_features() <em>In1 features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn1_features() |
| * @generated |
| * @ordered |
| */ |
| protected static final int IN1_FEATURES_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getIn1_features() <em>In1 features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn1_features() |
| * @generated |
| * @ordered |
| */ |
| protected int in1_features = IN1_FEATURES_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIn2_features() <em>In2 features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn2_features() |
| * @generated |
| * @ordered |
| */ |
| protected static final int IN2_FEATURES_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getIn2_features() <em>In2 features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn2_features() |
| * @generated |
| * @ordered |
| */ |
| protected int in2_features = IN2_FEATURES_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BilinearImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Linear_layersPackage.Literals.BILINEAR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getIn1_features() { |
| return in1_features; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIn1_features(int newIn1_features) { |
| int oldIn1_features = in1_features; |
| in1_features = newIn1_features; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.BILINEAR__IN1_FEATURES, oldIn1_features, in1_features)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getIn2_features() { |
| return in2_features; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIn2_features(int newIn2_features) { |
| int oldIn2_features = in2_features; |
| in2_features = newIn2_features; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.BILINEAR__IN2_FEATURES, oldIn2_features, in2_features)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Linear_layersPackage.BILINEAR__IN1_FEATURES: |
| return getIn1_features(); |
| case Linear_layersPackage.BILINEAR__IN2_FEATURES: |
| return getIn2_features(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Linear_layersPackage.BILINEAR__IN1_FEATURES: |
| setIn1_features((Integer)newValue); |
| return; |
| case Linear_layersPackage.BILINEAR__IN2_FEATURES: |
| setIn2_features((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Linear_layersPackage.BILINEAR__IN1_FEATURES: |
| setIn1_features(IN1_FEATURES_EDEFAULT); |
| return; |
| case Linear_layersPackage.BILINEAR__IN2_FEATURES: |
| setIn2_features(IN2_FEATURES_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Linear_layersPackage.BILINEAR__IN1_FEATURES: |
| return in1_features != IN1_FEATURES_EDEFAULT; |
| case Linear_layersPackage.BILINEAR__IN2_FEATURES: |
| return in2_features != IN2_FEATURES_EDEFAULT; |
| } |
| 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(" (in1_features: "); //$NON-NLS-1$ |
| result.append(in1_features); |
| result.append(", in2_features: "); //$NON-NLS-1$ |
| result.append(in2_features); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BilinearImpl |