| /** |
| * 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.Distance_functions.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.Distance_functions.Distance_functionsPackage; |
| import org.eclipse.papyrus.aiml.profile.AIML.Distance_functions.PairwiseDistance; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Pairwise Distance</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Distance_functions.impl.PairwiseDistanceImpl#getP <em>P</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Distance_functions.impl.PairwiseDistanceImpl#isKeepdim <em>Keepdim</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PairwiseDistanceImpl extends Distance_functionsImpl implements PairwiseDistance { |
| /** |
| * The default value of the '{@link #getP() <em>P</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getP() |
| * @generated |
| * @ordered |
| */ |
| protected static final double P_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getP() <em>P</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getP() |
| * @generated |
| * @ordered |
| */ |
| protected double p = P_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isKeepdim() <em>Keepdim</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isKeepdim() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean KEEPDIM_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isKeepdim() <em>Keepdim</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isKeepdim() |
| * @generated |
| * @ordered |
| */ |
| protected boolean keepdim = KEEPDIM_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PairwiseDistanceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Distance_functionsPackage.Literals.PAIRWISE_DISTANCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public double getP() { |
| return p; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setP(double newP) { |
| double oldP = p; |
| p = newP; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Distance_functionsPackage.PAIRWISE_DISTANCE__P, oldP, p)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isKeepdim() { |
| return keepdim; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setKeepdim(boolean newKeepdim) { |
| boolean oldKeepdim = keepdim; |
| keepdim = newKeepdim; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Distance_functionsPackage.PAIRWISE_DISTANCE__KEEPDIM, oldKeepdim, keepdim)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__P: |
| return getP(); |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__KEEPDIM: |
| return isKeepdim(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__P: |
| setP((Double)newValue); |
| return; |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__KEEPDIM: |
| setKeepdim((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__P: |
| setP(P_EDEFAULT); |
| return; |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__KEEPDIM: |
| setKeepdim(KEEPDIM_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__P: |
| return p != P_EDEFAULT; |
| case Distance_functionsPackage.PAIRWISE_DISTANCE__KEEPDIM: |
| return keepdim != KEEPDIM_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(" (p: "); //$NON-NLS-1$ |
| result.append(p); |
| result.append(", keepdim: "); //$NON-NLS-1$ |
| result.append(keepdim); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PairwiseDistanceImpl |