/**
*/
package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject;
import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage;
import java.util.Collection;
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.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Dir'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl#getContents Contents}
*
*
* @generated
*/
public class DirImpl extends FSObjectImpl implements Dir {
/**
* The cached value of the '{@link #getContents() Contents}' containment reference list.
*
*
* @see #getContents()
* @generated
* @ordered
*/
protected EList contents;
/**
*
*
* @generated
*/
protected DirImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return FilesystemPackage.Literals.DIR;
}
/**
*
*
* @generated
*/
@Override
public EList getContents() {
if (contents == null) {
contents = new EObjectContainmentWithInverseEList(FSObject.class, this, FilesystemPackage.DIR__CONTENTS, FilesystemPackage.FS_OBJECT__PARENT);
}
return contents;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
return ((InternalEList)(InternalEList>)getContents()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
return ((InternalEList>)getContents()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
return getContents();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
getContents().clear();
getContents().addAll((Collection extends FSObject>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
getContents().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FilesystemPackage.DIR__CONTENTS:
return contents != null && !contents.isEmpty();
}
return super.eIsSet(featureID);
}
} //DirImpl