| /** |
| * 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.Pooling_layers.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.MaxPool; |
| import org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.Pooling_layersPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Max Pool</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.impl.MaxPoolImpl#getDilation <em>Dilation</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.impl.MaxPoolImpl#isReturn_indices <em>Return indices</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class MaxPoolImpl extends Pooling_layers_1_1_1_1Impl implements MaxPool { |
| /** |
| * The cached value of the '{@link #getDilation() <em>Dilation</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDilation() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Integer> dilation; |
| |
| /** |
| * The default value of the '{@link #isReturn_indices() <em>Return indices</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isReturn_indices() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean RETURN_INDICES_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isReturn_indices() <em>Return indices</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isReturn_indices() |
| * @generated |
| * @ordered |
| */ |
| protected boolean return_indices = RETURN_INDICES_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MaxPoolImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Pooling_layersPackage.Literals.MAX_POOL; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<Integer> getDilation() { |
| if (dilation == null) { |
| dilation = new EDataTypeUniqueEList<Integer>(Integer.class, this, Pooling_layersPackage.MAX_POOL__DILATION); |
| } |
| return dilation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isReturn_indices() { |
| return return_indices; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setReturn_indices(boolean newReturn_indices) { |
| boolean oldReturn_indices = return_indices; |
| return_indices = newReturn_indices; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Pooling_layersPackage.MAX_POOL__RETURN_INDICES, oldReturn_indices, return_indices)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Pooling_layersPackage.MAX_POOL__DILATION: |
| return getDilation(); |
| case Pooling_layersPackage.MAX_POOL__RETURN_INDICES: |
| return isReturn_indices(); |
| } |
| 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 Pooling_layersPackage.MAX_POOL__DILATION: |
| getDilation().clear(); |
| getDilation().addAll((Collection<? extends Integer>)newValue); |
| return; |
| case Pooling_layersPackage.MAX_POOL__RETURN_INDICES: |
| setReturn_indices((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Pooling_layersPackage.MAX_POOL__DILATION: |
| getDilation().clear(); |
| return; |
| case Pooling_layersPackage.MAX_POOL__RETURN_INDICES: |
| setReturn_indices(RETURN_INDICES_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Pooling_layersPackage.MAX_POOL__DILATION: |
| return dilation != null && !dilation.isEmpty(); |
| case Pooling_layersPackage.MAX_POOL__RETURN_INDICES: |
| return return_indices != RETURN_INDICES_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(" (dilation: "); //$NON-NLS-1$ |
| result.append(dilation); |
| result.append(", return_indices: "); //$NON-NLS-1$ |
| result.append(return_indices); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //MaxPoolImpl |