blob: b1df877bb630fdab5e02a185b2f35569bd094b50 [file] [log] [blame]
/**
* Copyright (c) 2016 ALL4TEC & CEA LIST.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ALL4TEC & CEA LIST - initial API and implementation
*/
package org.polarsys.esf.esflocalanalysis.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.uml2.uml.Port;
import org.polarsys.esf.esfarchitectureconcepts.ISPort;
import org.polarsys.esf.esflocalanalysis.IESFLocalAnalysisPackage;
import org.polarsys.esf.esflocalanalysis.ISBlockLAnalysis;
import org.polarsys.esf.esflocalanalysis.ISPortLAnalysis;
import org.polarsys.esf.esflocalanalysis.SDirectionLAnalysis;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>SPort LAnalysis</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.polarsys.esf.esflocalanalysis.impl.SPortLAnalysis#getSBlockLAnalysis <em>SBlock LAnalysis</em>}</li>
* <li>{@link org.polarsys.esf.esflocalanalysis.impl.SPortLAnalysis#getSPort <em>SPort</em>}</li>
* <li>{@link org.polarsys.esf.esflocalanalysis.impl.SPortLAnalysis#getBase_Port <em>Base Port</em>}</li>
* <li>{@link org.polarsys.esf.esflocalanalysis.impl.SPortLAnalysis#getSDirectionLAnalysis <em>SDirection
* LAnalysis</em>}</li>
* </ul>
*
* @generated
*/
public class SPortLAnalysis
extends AbstractSFailureModeOwner
implements ISPortLAnalysis {
/**
* The cached value of the '{@link #getSPort() <em>SPort</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getSPort()
* @generated
* @ordered
*/
protected ISPort sPort;
/**
* The cached value of the '{@link #getBase_Port() <em>Base Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getBase_Port()
* @generated
* @ordered
*/
protected Port base_Port;
/**
* The default value of the '{@link #getSDirectionLAnalysis() <em>SDirection LAnalysis</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getSDirectionLAnalysis()
* @generated
* @ordered
*/
protected static final SDirectionLAnalysis SDIRECTION_LANALYSIS_EDEFAULT = SDirectionLAnalysis.IN;
/**
* The cached value of the '{@link #getSDirectionLAnalysis() <em>SDirection LAnalysis</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getSDirectionLAnalysis()
* @generated
* @ordered
*/
protected SDirectionLAnalysis sDirectionLAnalysis = SDIRECTION_LANALYSIS_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected SPortLAnalysis() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return IESFLocalAnalysisPackage.Literals.SPORT_LANALYSIS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public ISBlockLAnalysis getSBlockLAnalysis() {
ISBlockLAnalysis sBlockLAnalysis = basicGetSBlockLAnalysis();
return sBlockLAnalysis != null && sBlockLAnalysis.eIsProxy()
? (ISBlockLAnalysis) eResolveProxy((InternalEObject) sBlockLAnalysis)
: sBlockLAnalysis;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public ISBlockLAnalysis basicGetSBlockLAnalysis() {
// TODO: implement this method to return the 'SBlock LAnalysis' reference
// -> do not perform proxy resolution
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public void setSBlockLAnalysis(ISBlockLAnalysis newSBlockLAnalysis) {
// TODO: implement this method to set the 'SBlock LAnalysis' reference
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public ISPort getSPort() {
if (sPort != null && sPort.eIsProxy()) {
InternalEObject oldSPort = (InternalEObject) sPort;
sPort = (ISPort) eResolveProxy(oldSPort);
if (sPort != oldSPort) {
if (eNotificationRequired())
eNotify(
new ENotificationImpl(
this,
Notification.RESOLVE,
IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT,
oldSPort,
sPort));
}
}
return sPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public ISPort basicGetSPort() {
return sPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public void setSPort(ISPort newSPort) {
ISPort oldSPort = sPort;
sPort = newSPort;
if (eNotificationRequired())
eNotify(
new ENotificationImpl(
this,
Notification.SET,
IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT,
oldSPort,
sPort));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public Port getBase_Port() {
if (base_Port != null && base_Port.eIsProxy()) {
InternalEObject oldBase_Port = (InternalEObject) base_Port;
base_Port = (Port) eResolveProxy(oldBase_Port);
if (base_Port != oldBase_Port) {
if (eNotificationRequired())
eNotify(
new ENotificationImpl(
this,
Notification.RESOLVE,
IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT,
oldBase_Port,
base_Port));
}
}
return base_Port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public Port basicGetBase_Port() {
return base_Port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public void setBase_Port(Port newBase_Port) {
Port oldBase_Port = base_Port;
base_Port = newBase_Port;
if (eNotificationRequired())
eNotify(
new ENotificationImpl(
this,
Notification.SET,
IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT,
oldBase_Port,
base_Port));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public SDirectionLAnalysis getSDirectionLAnalysis() {
return sDirectionLAnalysis;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public void setSDirectionLAnalysis(SDirectionLAnalysis newSDirectionLAnalysis) {
SDirectionLAnalysis oldSDirectionLAnalysis = sDirectionLAnalysis;
sDirectionLAnalysis = newSDirectionLAnalysis == null ? SDIRECTION_LANALYSIS_EDEFAULT : newSDirectionLAnalysis;
if (eNotificationRequired())
eNotify(
new ENotificationImpl(
this,
Notification.SET,
IESFLocalAnalysisPackage.SPORT_LANALYSIS__SDIRECTION_LANALYSIS,
oldSDirectionLAnalysis,
sDirectionLAnalysis));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SBLOCK_LANALYSIS:
if (resolve)
return getSBlockLAnalysis();
return basicGetSBlockLAnalysis();
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT:
if (resolve)
return getSPort();
return basicGetSPort();
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT:
if (resolve)
return getBase_Port();
return basicGetBase_Port();
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SDIRECTION_LANALYSIS:
return getSDirectionLAnalysis();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SBLOCK_LANALYSIS:
setSBlockLAnalysis((ISBlockLAnalysis) newValue);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT:
setSPort((ISPort) newValue);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT:
setBase_Port((Port) newValue);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SDIRECTION_LANALYSIS:
setSDirectionLAnalysis((SDirectionLAnalysis) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SBLOCK_LANALYSIS:
setSBlockLAnalysis((ISBlockLAnalysis) null);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT:
setSPort((ISPort) null);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT:
setBase_Port((Port) null);
return;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SDIRECTION_LANALYSIS:
setSDirectionLAnalysis(SDIRECTION_LANALYSIS_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SBLOCK_LANALYSIS:
return basicGetSBlockLAnalysis() != null;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SPORT:
return sPort != null;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__BASE_PORT:
return base_Port != null;
case IESFLocalAnalysisPackage.SPORT_LANALYSIS__SDIRECTION_LANALYSIS:
return sDirectionLAnalysis != SDIRECTION_LANALYSIS_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (sDirectionLAnalysis: "); //$NON-NLS-1$
result.append(sDirectionLAnalysis);
result.append(')');
return result.toString();
}
} // SPortLAnalysis