/**
*/
package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
*
* An implementation of the model object 'File System'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getRoot Root}
* - {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getLive Live}
*
*
* @generated
*/
public class FileSystemImpl extends MinimalEObjectImpl.Container implements FileSystem {
/**
* The cached value of the '{@link #getRoot() Root}' containment reference.
*
*
* @see #getRoot()
* @generated
* @ordered
*/
protected FSObject root;
/**
* The cached setting delegate for the '{@link #getLive() Live}' reference list.
*
*
* @see #getLive()
* @generated
* @ordered
*/
protected EStructuralFeature.Internal.SettingDelegate LIVE__ESETTING_DELEGATE = ((EStructuralFeature.Internal)FilesystemPackage.Literals.FILE_SYSTEM__LIVE).getSettingDelegate();
/**
*
*
* @generated
*/
protected FileSystemImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return FilesystemPackage.Literals.FILE_SYSTEM;
}
/**
*
*
* @generated
*/
@Override
public FSObject getRoot() {
return root;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRoot(FSObject newRoot, NotificationChain msgs) {
FSObject oldRoot = root;
root = newRoot;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, oldRoot, newRoot);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setRoot(FSObject newRoot) {
if (newRoot != root) {
NotificationChain msgs = null;
if (root != null)
msgs = ((InternalEObject)root).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs);
if (newRoot != null)
msgs = ((InternalEObject)newRoot).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs);
msgs = basicSetRoot(newRoot, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, newRoot, newRoot));
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getLive() {
return (EList)LIVE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FilesystemPackage.FILE_SYSTEM__ROOT:
return basicSetRoot(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FilesystemPackage.FILE_SYSTEM__ROOT:
return getRoot();
case FilesystemPackage.FILE_SYSTEM__LIVE:
return getLive();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FilesystemPackage.FILE_SYSTEM__ROOT:
setRoot((FSObject)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FilesystemPackage.FILE_SYSTEM__ROOT:
setRoot((FSObject)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FilesystemPackage.FILE_SYSTEM__ROOT:
return root != null;
case FilesystemPackage.FILE_SYSTEM__LIVE:
return LIVE__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
}
return super.eIsSet(featureID);
}
} //FileSystemImpl