/**
*/
package hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Constant;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Function;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.ContainmentHierarchy;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Logic Problem'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getTypes Types}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getFunctions Functions}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getAssertions Assertions}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getRelations Relations}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getConstants Constants}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getElements Elements}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getContainmentHierarchies Containment Hierarchies}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.LogicProblemImpl#getAnnotations Annotations}
*
*
* @generated
*/
public class LogicProblemImpl extends MinimalEObjectImpl.Container implements LogicProblem {
/**
* The cached value of the '{@link #getTypes() Types}' containment reference list.
*
*
* @see #getTypes()
* @generated
* @ordered
*/
protected EList types;
/**
* The cached value of the '{@link #getFunctions() Functions}' containment reference list.
*
*
* @see #getFunctions()
* @generated
* @ordered
*/
protected EList functions;
/**
* The cached value of the '{@link #getAssertions() Assertions}' containment reference list.
*
*
* @see #getAssertions()
* @generated
* @ordered
*/
protected EList assertions;
/**
* The cached value of the '{@link #getRelations() Relations}' containment reference list.
*
*
* @see #getRelations()
* @generated
* @ordered
*/
protected EList relations;
/**
* The cached value of the '{@link #getConstants() Constants}' containment reference list.
*
*
* @see #getConstants()
* @generated
* @ordered
*/
protected EList constants;
/**
* The cached value of the '{@link #getElements() Elements}' containment reference list.
*
*
* @see #getElements()
* @generated
* @ordered
*/
protected EList elements;
/**
* The cached value of the '{@link #getContainmentHierarchies() Containment Hierarchies}' containment reference list.
*
*
* @see #getContainmentHierarchies()
* @generated
* @ordered
*/
protected EList containmentHierarchies;
/**
* The cached value of the '{@link #getAnnotations() Annotations}' containment reference list.
*
*
* @see #getAnnotations()
* @generated
* @ordered
*/
protected EList annotations;
/**
*
*
* @generated
*/
protected LogicProblemImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return LogicproblemPackage.Literals.LOGIC_PROBLEM;
}
/**
*
*
* @generated
*/
public EList getTypes() {
if (types == null) {
types = new EObjectContainmentEList(Type.class, this, LogicproblemPackage.LOGIC_PROBLEM__TYPES);
}
return types;
}
/**
*
*
* @generated
*/
public EList getFunctions() {
if (functions == null) {
functions = new EObjectContainmentEList(Function.class, this, LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS);
}
return functions;
}
/**
*
*
* @generated
*/
public EList getAssertions() {
if (assertions == null) {
assertions = new EObjectContainmentEList(Assertion.class, this, LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS);
}
return assertions;
}
/**
*
*
* @generated
*/
public EList getRelations() {
if (relations == null) {
relations = new EObjectContainmentEList(Relation.class, this, LogicproblemPackage.LOGIC_PROBLEM__RELATIONS);
}
return relations;
}
/**
*
*
* @generated
*/
public EList getConstants() {
if (constants == null) {
constants = new EObjectContainmentEList(Constant.class, this, LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS);
}
return constants;
}
/**
*
*
* @generated
*/
public EList getElements() {
if (elements == null) {
elements = new EObjectContainmentEList(DefinedElement.class, this, LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS);
}
return elements;
}
/**
*
*
* @generated
*/
public EList getContainmentHierarchies() {
if (containmentHierarchies == null) {
containmentHierarchies = new EObjectContainmentEList(ContainmentHierarchy.class, this, LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES);
}
return containmentHierarchies;
}
/**
*
*
* @generated
*/
public EList getAnnotations() {
if (annotations == null) {
annotations = new EObjectContainmentEList(Annotation.class, this, LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS);
}
return annotations;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case LogicproblemPackage.LOGIC_PROBLEM__TYPES:
return ((InternalEList>)getTypes()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS:
return ((InternalEList>)getFunctions()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS:
return ((InternalEList>)getAssertions()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__RELATIONS:
return ((InternalEList>)getRelations()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS:
return ((InternalEList>)getConstants()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS:
return ((InternalEList>)getElements()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES:
return ((InternalEList>)getContainmentHierarchies()).basicRemove(otherEnd, msgs);
case LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS:
return ((InternalEList>)getAnnotations()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case LogicproblemPackage.LOGIC_PROBLEM__TYPES:
return getTypes();
case LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS:
return getFunctions();
case LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS:
return getAssertions();
case LogicproblemPackage.LOGIC_PROBLEM__RELATIONS:
return getRelations();
case LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS:
return getConstants();
case LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS:
return getElements();
case LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES:
return getContainmentHierarchies();
case LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS:
return getAnnotations();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case LogicproblemPackage.LOGIC_PROBLEM__TYPES:
getTypes().clear();
getTypes().addAll((Collection extends Type>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS:
getFunctions().clear();
getFunctions().addAll((Collection extends Function>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS:
getAssertions().clear();
getAssertions().addAll((Collection extends Assertion>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__RELATIONS:
getRelations().clear();
getRelations().addAll((Collection extends Relation>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS:
getConstants().clear();
getConstants().addAll((Collection extends Constant>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS:
getElements().clear();
getElements().addAll((Collection extends DefinedElement>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES:
getContainmentHierarchies().clear();
getContainmentHierarchies().addAll((Collection extends ContainmentHierarchy>)newValue);
return;
case LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS:
getAnnotations().clear();
getAnnotations().addAll((Collection extends Annotation>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case LogicproblemPackage.LOGIC_PROBLEM__TYPES:
getTypes().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS:
getFunctions().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS:
getAssertions().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__RELATIONS:
getRelations().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS:
getConstants().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS:
getElements().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES:
getContainmentHierarchies().clear();
return;
case LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS:
getAnnotations().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case LogicproblemPackage.LOGIC_PROBLEM__TYPES:
return types != null && !types.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__FUNCTIONS:
return functions != null && !functions.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__ASSERTIONS:
return assertions != null && !assertions.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__RELATIONS:
return relations != null && !relations.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__CONSTANTS:
return constants != null && !constants.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__ELEMENTS:
return elements != null && !elements.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__CONTAINMENT_HIERARCHIES:
return containmentHierarchies != null && !containmentHierarchies.isEmpty();
case LogicproblemPackage.LOGIC_PROBLEM__ANNOTATIONS:
return annotations != null && !annotations.isEmpty();
}
return super.eIsSet(featureID);
}
} //LogicProblemImpl