Commit 8845f263 authored by Dominique Marcadet's avatar Dominique Marcadet

move LDevice <--> LN0 and LDevice <--> LN to LDevice <--> AnyLN

FeatureMap are used to keep LDevice --> LN0 and LDevice --> LN
parent 87695a9c
......@@ -170,8 +170,8 @@ public class LDeviceItemProvider extends UnNamingItemProvider {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(SclPackage.eINSTANCE.getLDevice_AccessControl());
childrenFeatures.add(SclPackage.eINSTANCE.getLDevice_LN());
childrenFeatures.add(SclPackage.eINSTANCE.getLDevice_LN0());
childrenFeatures.add(SclPackage.eINSTANCE.getLDevice_LN());
}
return childrenFeatures;
}
......@@ -232,8 +232,8 @@ public class LDeviceItemProvider extends UnNamingItemProvider {
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case SclPackage.LDEVICE__ACCESS_CONTROL:
case SclPackage.LDEVICE__LN:
case SclPackage.LDEVICE__LN0:
case SclPackage.LDEVICE__LN:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
......@@ -258,13 +258,13 @@ public class LDeviceItemProvider extends UnNamingItemProvider {
newChildDescriptors.add
(createChildParameter
(SclPackage.eINSTANCE.getLDevice_LN(),
SclFactory.eINSTANCE.createLN()));
(SclPackage.eINSTANCE.getLDevice_LN0(),
SclFactory.eINSTANCE.createLN0()));
newChildDescriptors.add
(createChildParameter
(SclPackage.eINSTANCE.getLDevice_LN0(),
SclFactory.eINSTANCE.createLN0()));
(SclPackage.eINSTANCE.getLDevice_LN(),
SclFactory.eINSTANCE.createLN()));
}
}
......@@ -1153,11 +1153,25 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="LNode" ordered="false"
upperBound="-1" eType="#//LNode" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//LNode/LDevice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="LN" ordered="false" upperBound="-1"
eType="#//LN" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//LN/LDevice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="LN0" ordered="false" eType="#//LN0"
unsettable="true" containment="true" resolveProxies="false" eOpposite="#//LN0/LDevice"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="AnyLN" ordered="false"
upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry"
transient="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="group"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="LN0" eType="#//LN0" volatile="true"
unsettable="true" containment="true" eOpposite="#//LN0/LDevice">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#AnyLN"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="LN" upperBound="-1" eType="#//LN"
volatile="true" unsettable="true" containment="true" eOpposite="#//LN/LDevice">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="group" value="#AnyLN"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LN" eSuperTypes="#//AnyLN">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="prefix" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
......
......@@ -640,8 +640,9 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/AccessControl"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/Server"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/LNode"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/LN"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//LDevice/AnyLN"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/LN0"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//LDevice/LN"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//LN">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//LN/prefix"/>
......
......@@ -20,6 +20,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.util.FeatureMap;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.IED;
/**
......@@ -37,8 +38,9 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.IED;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getServer <em>Server</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getLNode <em>LNode</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getLN <em>LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getAnyLN <em>Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getLN0 <em>LN0</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getLN <em>LN</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLDevice()
......@@ -317,6 +319,19 @@ public interface LDevice extends UnNaming {
*/
boolean isSetLNode();
/**
* Returns the value of the '<em><b>Any LN</b></em>' attribute list.
* The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Any LN</em>' attribute list.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLDevice_AnyLN()
* @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" transient="true" ordered="false"
* extendedMetaData="kind='group'"
* @generated
*/
FeatureMap getAnyLN();
/**
* Returns the value of the '<em><b>LN</b></em>' containment reference list.
* The list contents are of type {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LN}.
......@@ -332,7 +347,8 @@ public interface LDevice extends UnNaming {
* @see #unsetLN()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLDevice_LN()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.LN#getLDevice
* @model opposite="LDevice" containment="true" unsettable="true" ordered="false"
* @model opposite="LDevice" containment="true" unsettable="true" volatile="true"
* extendedMetaData="group='#AnyLN'"
* @generated
*/
EList<LN> getLN();
......@@ -373,7 +389,8 @@ public interface LDevice extends UnNaming {
* @see #setLN0(LN0)
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLDevice_LN0()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.LN0#getLDevice
* @model opposite="LDevice" containment="true" unsettable="true" ordered="false"
* @model opposite="LDevice" containment="true" unsettable="true" volatile="true"
* extendedMetaData="group='#AnyLN'"
* @generated
*/
LN0 getLN0();
......
......@@ -10669,13 +10669,13 @@ public interface SclPackage extends EPackage {
int LDEVICE__LNODE = UN_NAMING_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>LN</b></em>' containment reference list.
* The feature id for the '<em><b>Any LN</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LDEVICE__LN = UN_NAMING_FEATURE_COUNT + 6;
int LDEVICE__ANY_LN = UN_NAMING_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>LN0</b></em>' containment reference.
......@@ -10686,6 +10686,15 @@ public interface SclPackage extends EPackage {
*/
int LDEVICE__LN0 = UN_NAMING_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>LN</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LDEVICE__LN = UN_NAMING_FEATURE_COUNT + 8;
/**
* The number of structural features of the '<em>LDevice</em>' class.
* <!-- begin-user-doc -->
......@@ -10693,7 +10702,7 @@ public interface SclPackage extends EPackage {
* @generated
* @ordered
*/
int LDEVICE_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 8;
int LDEVICE_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 9;
/**
* The number of operations of the '<em>LDevice</em>' class.
......@@ -23261,6 +23270,17 @@ public interface SclPackage extends EPackage {
*/
EReference getLDevice_LNode();
/**
* Returns the meta object for the attribute list '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getAnyLN <em>Any LN</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Any LN</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getAnyLN()
* @see #getLDevice()
* @generated
*/
EAttribute getLDevice_AnyLN();
/**
* Returns the meta object for the containment reference list '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice#getLN <em>LN</em>}'.
* <!-- begin-user-doc -->
......
......@@ -25,9 +25,10 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.EObjectWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AccessControl;
......@@ -54,8 +55,9 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.Server;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getServer <em>Server</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getLNode <em>LNode</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getLN <em>LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getAnyLN <em>Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getLN0 <em>LN0</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LDeviceImpl#getLN <em>LN</em>}</li>
* </ul>
*
* @generated
......@@ -127,7 +129,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
* @ordered
*/
protected EList<ControlBlock> referredByControlBlock;
protected EList< ControlBlock > referredByControlBlock;
/**
* The cached value of the '{@link #getAccessControl() <em>Access Control</em>}' containment reference.
......@@ -156,36 +158,17 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
* @ordered
*/
protected EList<LNode> lNode;
/**
* The cached value of the '{@link #getLN() <em>LN</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLN()
* @generated
* @ordered
*/
protected EList<LN> ln;
protected EList< LNode > lNode;
/**
* The cached value of the '{@link #getLN0() <em>LN0</em>}' containment reference.
* The cached value of the '{@link #getAnyLN() <em>Any LN</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLN0()
* @see #getAnyLN()
* @generated
* @ordered
*/
protected LN0 ln0;
/**
* This is true if the LN0 containment reference has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean ln0ESet;
protected FeatureMap anyLN;
/**
* <!-- begin-user-doc -->
......@@ -227,8 +210,8 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
inst = newInst;
boolean oldInstESet = instESet;
instESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__INST, oldInst, inst, !oldInstESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.SET, SclPackage.LDEVICE__INST, oldInst, inst, !oldInstESet ));
}
/**
......@@ -242,8 +225,8 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
boolean oldInstESet = instESet;
inst = INST_EDEFAULT;
instESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, SclPackage.LDEVICE__INST, oldInst, INST_EDEFAULT, oldInstESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.UNSET, SclPackage.LDEVICE__INST, oldInst, INST_EDEFAULT, oldInstESet ));
}
/**
......@@ -280,8 +263,8 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
ldName = newLdName;
boolean oldLdNameESet = ldNameESet;
ldNameESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__LD_NAME, oldLdName, ldName, !oldLdNameESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.SET, SclPackage.LDEVICE__LD_NAME, oldLdName, ldName, !oldLdNameESet ));
}
/**
......@@ -295,8 +278,8 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
boolean oldLdNameESet = ldNameESet;
ldName = LD_NAME_EDEFAULT;
ldNameESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, SclPackage.LDEVICE__LD_NAME, oldLdName, LD_NAME_EDEFAULT, oldLdNameESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.UNSET, SclPackage.LDEVICE__LD_NAME, oldLdName, LD_NAME_EDEFAULT, oldLdNameESet ));
}
/**
......@@ -315,9 +298,10 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
*/
@Override
public EList<ControlBlock> getReferredByControlBlock() {
if (referredByControlBlock == null) {
referredByControlBlock = new EObjectWithInverseEList.Unsettable<ControlBlock>(ControlBlock.class, this, SclPackage.LDEVICE__REFERRED_BY_CONTROL_BLOCK, SclPackage.CONTROL_BLOCK__REFERS_TO_LDEVICE);
public EList< ControlBlock > getReferredByControlBlock() {
if( referredByControlBlock == null ) {
referredByControlBlock = new EObjectWithInverseEList.Unsettable< ControlBlock >( ControlBlock.class, this,
SclPackage.LDEVICE__REFERRED_BY_CONTROL_BLOCK, SclPackage.CONTROL_BLOCK__REFERS_TO_LDEVICE );
}
return referredByControlBlock;
}
......@@ -329,7 +313,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void unsetReferredByControlBlock() {
if (referredByControlBlock != null) ((InternalEList.Unsettable<?>)referredByControlBlock).unset();
if( referredByControlBlock != null ) (( InternalEList.Unsettable< ? > ) referredByControlBlock ).unset();
}
/**
......@@ -339,7 +323,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public boolean isSetReferredByControlBlock() {
return referredByControlBlock != null && ((InternalEList.Unsettable<?>)referredByControlBlock).isSet();
return referredByControlBlock != null && (( InternalEList.Unsettable< ? > ) referredByControlBlock ).isSet();
}
/**
......@@ -362,9 +346,13 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
accessControl = newAccessControl;
boolean oldAccessControlESet = accessControlESet;
accessControlESet = true;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__ACCESS_CONTROL, oldAccessControl, newAccessControl, !oldAccessControlESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
if( eNotificationRequired() ) {
ENotificationImpl notification = new ENotificationImpl( this, Notification.SET,
SclPackage.LDEVICE__ACCESS_CONTROL, oldAccessControl, newAccessControl, !oldAccessControlESet );
if( msgs == null )
msgs = notification;
else
msgs.add( notification );
}
return msgs;
}
......@@ -376,20 +364,23 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void setAccessControl( AccessControl newAccessControl ) {
if (newAccessControl != accessControl) {
if( newAccessControl != accessControl ) {
NotificationChain msgs = null;
if (accessControl != null)
msgs = ((InternalEObject)accessControl).eInverseRemove(this, SclPackage.ACCESS_CONTROL__LDEVICE, AccessControl.class, msgs);
if (newAccessControl != null)
msgs = ((InternalEObject)newAccessControl).eInverseAdd(this, SclPackage.ACCESS_CONTROL__LDEVICE, AccessControl.class, msgs);
msgs = basicSetAccessControl(newAccessControl, msgs);
if (msgs != null) msgs.dispatch();
if( accessControl != null )
msgs = (( InternalEObject ) accessControl ).eInverseRemove( this, SclPackage.ACCESS_CONTROL__LDEVICE,
AccessControl.class, msgs );
if( newAccessControl != null )
msgs = (( InternalEObject ) newAccessControl ).eInverseAdd( this, SclPackage.ACCESS_CONTROL__LDEVICE,
AccessControl.class, msgs );
msgs = basicSetAccessControl( newAccessControl, msgs );
if( msgs != null ) msgs.dispatch();
}
else {
boolean oldAccessControlESet = accessControlESet;
accessControlESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__ACCESS_CONTROL, newAccessControl, newAccessControl, !oldAccessControlESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.SET, SclPackage.LDEVICE__ACCESS_CONTROL,
newAccessControl, newAccessControl, !oldAccessControlESet ));
}
}
......@@ -403,9 +394,13 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
accessControl = null;
boolean oldAccessControlESet = accessControlESet;
accessControlESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, SclPackage.LDEVICE__ACCESS_CONTROL, oldAccessControl, null, oldAccessControlESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
if( eNotificationRequired() ) {
ENotificationImpl notification = new ENotificationImpl( this, Notification.UNSET,
SclPackage.LDEVICE__ACCESS_CONTROL, oldAccessControl, null, oldAccessControlESet );
if( msgs == null )
msgs = notification;
else
msgs.add( notification );
}
return msgs;
}
......@@ -417,17 +412,19 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void unsetAccessControl() {
if (accessControl != null) {
if( accessControl != null ) {
NotificationChain msgs = null;
msgs = ((InternalEObject)accessControl).eInverseRemove(this, SclPackage.ACCESS_CONTROL__LDEVICE, AccessControl.class, msgs);
msgs = basicUnsetAccessControl(msgs);
if (msgs != null) msgs.dispatch();
msgs = ( ( InternalEObject ) accessControl ).eInverseRemove( this, SclPackage.ACCESS_CONTROL__LDEVICE,
AccessControl.class, msgs );
msgs = basicUnsetAccessControl( msgs );
if( msgs != null ) msgs.dispatch();
}
else {
boolean oldAccessControlESet = accessControlESet;
accessControlESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, SclPackage.LDEVICE__ACCESS_CONTROL, null, null, oldAccessControlESet));
if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.UNSET, SclPackage.LDEVICE__ACCESS_CONTROL, null,
null, oldAccessControlESet ) );
}
}
......@@ -448,8 +445,8 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public Server getServer() {
if (eContainerFeatureID() != SclPackage.LDEVICE__SERVER) return null;
return (Server)eInternalContainer();
if( eContainerFeatureID() != SclPackage.LDEVICE__SERVER ) return null;
return ( Server ) eInternalContainer();
}
/**
......@@ -458,7 +455,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
*/
public NotificationChain basicSetServer( Server newServer, NotificationChain msgs ) {
msgs = eBasicSetContainer((InternalEObject)newServer, SclPackage.LDEVICE__SERVER, msgs);
msgs = eBasicSetContainer( ( InternalEObject ) newServer, SclPackage.LDEVICE__SERVER, msgs );
return msgs;
}
......@@ -469,19 +466,22 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void setServer( Server newServer ) {
if (newServer != eInternalContainer() || (eContainerFeatureID() != SclPackage.LDEVICE__SERVER && newServer != null)) {
if (EcoreUtil.isAncestor(this, newServer))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
if( newServer != eInternalContainer()
|| ( eContainerFeatureID() != SclPackage.LDEVICE__SERVER && newServer != null ) ) {
if( EcoreUtil.isAncestor( this, newServer ) )
throw new IllegalArgumentException( "Recursive containment not allowed for " + toString() );
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newServer != null)
msgs = ((InternalEObject)newServer).eInverseAdd(this, SclPackage.SERVER__LDEVICE, Server.class, msgs);
msgs = basicSetServer(newServer, msgs);
if (msgs != null) msgs.dispatch();
if( eInternalContainer() != null )
msgs = eBasicRemoveFromContainer( msgs );
if( newServer != null )
msgs = ( ( InternalEObject ) newServer ).eInverseAdd( this, SclPackage.SERVER__LDEVICE, Server.class,
msgs );
msgs = basicSetServer( newServer, msgs );
if( msgs != null ) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__SERVER, newServer, newServer));
else if( eNotificationRequired() )
eNotify( new ENotificationImpl( this, Notification.SET, SclPackage.LDEVICE__SERVER, newServer,
newServer ) );
}
/**
......@@ -490,9 +490,10 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
*/
@Override
public EList<LNode> getLNode() {
if (lNode == null) {
lNode = new EObjectWithInverseEList.Unsettable<LNode>(LNode.class, this, SclPackage.LDEVICE__LNODE, SclPackage.LNODE__LDEVICE);
public EList< LNode > getLNode() {
if( lNode == null ) {
lNode = new EObjectWithInverseEList.Unsettable< LNode >( LNode.class, this, SclPackage.LDEVICE__LNODE,
SclPackage.LNODE__LDEVICE );
}
return lNode;
}
......@@ -504,7 +505,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void unsetLNode() {
if (lNode != null) ((InternalEList.Unsettable<?>)lNode).unset();
if( lNode != null ) ( ( InternalEList.Unsettable< ? > ) lNode ).unset();
}
/**
......@@ -514,7 +515,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public boolean isSetLNode() {
return lNode != null && ((InternalEList.Unsettable<?>)lNode).isSet();
return lNode != null && ( ( InternalEList.Unsettable< ? > ) lNode ).isSet();
}
/**
......@@ -523,11 +524,21 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
*/
@Override
public EList<LN> getLN() {
if (ln == null) {
ln = new EObjectContainmentWithInverseEList.Unsettable<LN>(LN.class, this, SclPackage.LDEVICE__LN, SclPackage.LN__LDEVICE);
public FeatureMap getAnyLN() {
if( anyLN == null ) {
anyLN = new BasicFeatureMap( this, SclPackage.LDEVICE__ANY_LN );
}
return ln;
return anyLN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList< LN > getLN() {
return getAnyLN().list( SclPackage.eINSTANCE.getLDevice_LN() );
}
/**
......@@ -537,7 +548,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void unsetLN() {
if (ln != null) ((InternalEList.Unsettable<?>)ln).unset();
( ( FeatureMap.Internal ) getAnyLN() ).clear( SclPackage.eINSTANCE.getLDevice_LN() );
}
/**
......@@ -547,7 +558,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public boolean isSetLN() {
return ln != null && ((InternalEList.Unsettable<?>)ln).isSet();
return !( ( FeatureMap.Internal ) getAnyLN() ).isEmpty( SclPackage.eINSTANCE.getLDevice_LN() );
}
/**
......@@ -557,7 +568,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public LN0 getLN0() {
return ln0;
return ( LN0 ) getAnyLN().get( SclPackage.eINSTANCE.getLDevice_LN0(), true );
}
/**
......@@ -566,15 +577,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
* @generated
*/
public NotificationChain basicSetLN0( LN0 newLN0, NotificationChain msgs ) {
LN0 oldLN0 = ln0;
ln0 = newLN0;
boolean oldLN0ESet = ln0ESet;
ln0ESet = true;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__LN0, oldLN0, newLN0, !oldLN0ESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
return (( FeatureMap.Internal ) getAnyLN() ).basicAdd( SclPackage.eINSTANCE.getLDevice_LN0(), newLN0, msgs );
}
/**
......@@ -584,36 +587,24 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void setLN0( LN0 newLN0 ) {
if (newLN0 != ln0) {
NotificationChain msgs = null;
if (ln0 != null)
msgs = ((InternalEObject)ln0).eInverseRemove(this, SclPackage.LN0__LDEVICE, LN0.class, msgs);
if (newLN0 != null)
msgs = ((InternalEObject)newLN0).eInverseAdd(this, SclPackage.LN0__LDEVICE, LN0.class, msgs);
msgs = basicSetLN0(newLN0, msgs);
if (msgs != null) msgs.dispatch();
}
else {
boolean oldLN0ESet = ln0ESet;
ln0ESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LDEVICE__LN0, newLN0, newLN0, !oldLN0ESet));
}
( ( FeatureMap.Internal ) getAnyLN() ).set( SclPackage.eINSTANCE.getLDevice_LN0(), newLN0 );
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
public NotificationChain basicUnsetLN0( NotificationChain msgs ) {
LN0 oldLN0 = ln0;
ln0 = null;
boolean oldLN0ESet = ln0ESet;
ln0ESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, SclPackage.LDEVICE__LN0, oldLN0, null, oldLN0ESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
LN0 oldLN0 = getLN0();
getAnyLN().remove( oldLN0 );
boolean oldLN0ESet = isSetLN0();
if( eNotificationRequired() ) {
ENotificationImpl notification = new ENotificationImpl( this, Notification.UNSET, SclPackage.LDEVICE__LN0, oldLN0, null, oldLN0ESet );
if( msgs == null )
msgs = notification;
else
msgs.add( notification );
}
return msgs;
}
......@@ -625,18 +616,7 @@ public class LDeviceImpl extends UnNamingImpl implements LDevice {
*/
@Override
public void unsetLN0() {