| /** |
| * 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.Convolution_layers.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.aiml.profile.AIML.Convolution_layers.Convolution_layersPackage; |
| import org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.basic; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_constraints.constraints; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>basic</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.impl.basicImpl#getKernel_initializer <em>Kernel initializer</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.impl.basicImpl#getKernel_constraint <em>Kernel constraint</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.impl.basicImpl#getKernel_regularizer <em>Kernel regularizer</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class basicImpl extends LayerWithFilterImpl implements basic { |
| /** |
| * The default value of the '{@link #getKernel_initializer() <em>Kernel initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected static final String KERNEL_INITIALIZER_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getKernel_initializer() <em>Kernel initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected String kernel_initializer = KERNEL_INITIALIZER_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getKernel_constraint() <em>Kernel constraint</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_constraint() |
| * @generated |
| * @ordered |
| */ |
| protected constraints kernel_constraint; |
| |
| /** |
| * The default value of the '{@link #getKernel_regularizer() <em>Kernel regularizer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_regularizer() |
| * @generated |
| * @ordered |
| */ |
| protected static final String KERNEL_REGULARIZER_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getKernel_regularizer() <em>Kernel regularizer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_regularizer() |
| * @generated |
| * @ordered |
| */ |
| protected String kernel_regularizer = KERNEL_REGULARIZER_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected basicImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Convolution_layersPackage.Literals.BASIC; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getKernel_initializer() { |
| return kernel_initializer; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setKernel_initializer(String newKernel_initializer) { |
| String oldKernel_initializer = kernel_initializer; |
| kernel_initializer = newKernel_initializer; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Convolution_layersPackage.BASIC__KERNEL_INITIALIZER, oldKernel_initializer, kernel_initializer)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public constraints getKernel_constraint() { |
| if (kernel_constraint != null && kernel_constraint.eIsProxy()) { |
| InternalEObject oldKernel_constraint = (InternalEObject)kernel_constraint; |
| kernel_constraint = (constraints)eResolveProxy(oldKernel_constraint); |
| if (kernel_constraint != oldKernel_constraint) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT, oldKernel_constraint, kernel_constraint)); |
| } |
| } |
| return kernel_constraint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public constraints basicGetKernel_constraint() { |
| return kernel_constraint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setKernel_constraint(constraints newKernel_constraint) { |
| constraints oldKernel_constraint = kernel_constraint; |
| kernel_constraint = newKernel_constraint; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT, oldKernel_constraint, kernel_constraint)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getKernel_regularizer() { |
| return kernel_regularizer; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setKernel_regularizer(String newKernel_regularizer) { |
| String oldKernel_regularizer = kernel_regularizer; |
| kernel_regularizer = newKernel_regularizer; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Convolution_layersPackage.BASIC__KERNEL_REGULARIZER, oldKernel_regularizer, kernel_regularizer)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Convolution_layersPackage.BASIC__KERNEL_INITIALIZER: |
| return getKernel_initializer(); |
| case Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT: |
| if (resolve) return getKernel_constraint(); |
| return basicGetKernel_constraint(); |
| case Convolution_layersPackage.BASIC__KERNEL_REGULARIZER: |
| return getKernel_regularizer(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Convolution_layersPackage.BASIC__KERNEL_INITIALIZER: |
| setKernel_initializer((String)newValue); |
| return; |
| case Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT: |
| setKernel_constraint((constraints)newValue); |
| return; |
| case Convolution_layersPackage.BASIC__KERNEL_REGULARIZER: |
| setKernel_regularizer((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Convolution_layersPackage.BASIC__KERNEL_INITIALIZER: |
| setKernel_initializer(KERNEL_INITIALIZER_EDEFAULT); |
| return; |
| case Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT: |
| setKernel_constraint((constraints)null); |
| return; |
| case Convolution_layersPackage.BASIC__KERNEL_REGULARIZER: |
| setKernel_regularizer(KERNEL_REGULARIZER_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Convolution_layersPackage.BASIC__KERNEL_INITIALIZER: |
| return KERNEL_INITIALIZER_EDEFAULT == null ? kernel_initializer != null : !KERNEL_INITIALIZER_EDEFAULT.equals(kernel_initializer); |
| case Convolution_layersPackage.BASIC__KERNEL_CONSTRAINT: |
| return kernel_constraint != null; |
| case Convolution_layersPackage.BASIC__KERNEL_REGULARIZER: |
| return KERNEL_REGULARIZER_EDEFAULT == null ? kernel_regularizer != null : !KERNEL_REGULARIZER_EDEFAULT.equals(kernel_regularizer); |
| } |
| 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(" (kernel_initializer: "); //$NON-NLS-1$ |
| result.append(kernel_initializer); |
| result.append(", kernel_regularizer: "); //$NON-NLS-1$ |
| result.append(kernel_regularizer); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //basicImpl |