/**
*/
package hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.impl;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.RelationAnnotationImpl;
import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.TransfomedViatraQuery;
import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.VariableMapping;
import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.Viatra2LogicAnnotationsPackage;
import java.util.Collection;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Transfomed Viatra Query'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.impl.TransfomedViatraQueryImpl#getPatternFullyQualifiedName Pattern Fully Qualified Name}
* - {@link hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.impl.TransfomedViatraQueryImpl#getPatternPQuery Pattern PQuery}
* - {@link hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.impl.TransfomedViatraQueryImpl#getVariableTrace Variable Trace}
*
*
* @generated
*/
public class TransfomedViatraQueryImpl extends RelationAnnotationImpl implements TransfomedViatraQuery {
/**
* The default value of the '{@link #getPatternFullyQualifiedName() Pattern Fully Qualified Name}' attribute.
*
*
* @see #getPatternFullyQualifiedName()
* @generated
* @ordered
*/
protected static final String PATTERN_FULLY_QUALIFIED_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getPatternFullyQualifiedName() Pattern Fully Qualified Name}' attribute.
*
*
* @see #getPatternFullyQualifiedName()
* @generated
* @ordered
*/
protected String patternFullyQualifiedName = PATTERN_FULLY_QUALIFIED_NAME_EDEFAULT;
/**
* The default value of the '{@link #getPatternPQuery() Pattern PQuery}' attribute.
*
*
* @see #getPatternPQuery()
* @generated
* @ordered
*/
protected static final Object PATTERN_PQUERY_EDEFAULT = null;
/**
* The cached value of the '{@link #getPatternPQuery() Pattern PQuery}' attribute.
*
*
* @see #getPatternPQuery()
* @generated
* @ordered
*/
protected Object patternPQuery = PATTERN_PQUERY_EDEFAULT;
/**
* The cached value of the '{@link #getVariableTrace() Variable Trace}' containment reference list.
*
*
* @see #getVariableTrace()
* @generated
* @ordered
*/
protected EList variableTrace;
/**
*
*
* @generated
*/
protected TransfomedViatraQueryImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Viatra2LogicAnnotationsPackage.Literals.TRANSFOMED_VIATRA_QUERY;
}
/**
*
*
* @generated
*/
@Override
public String getPatternFullyQualifiedName() {
return patternFullyQualifiedName;
}
/**
*
*
* @generated
*/
@Override
public void setPatternFullyQualifiedName(String newPatternFullyQualifiedName) {
String oldPatternFullyQualifiedName = patternFullyQualifiedName;
patternFullyQualifiedName = newPatternFullyQualifiedName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_FULLY_QUALIFIED_NAME, oldPatternFullyQualifiedName, patternFullyQualifiedName));
}
/**
*
*
* @generated
*/
@Override
public Object getPatternPQuery() {
return patternPQuery;
}
/**
*
*
* @generated
*/
@Override
public void setPatternPQuery(Object newPatternPQuery) {
Object oldPatternPQuery = patternPQuery;
patternPQuery = newPatternPQuery;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_PQUERY, oldPatternPQuery, patternPQuery));
}
/**
*
*
* @generated
*/
@Override
public EList getVariableTrace() {
if (variableTrace == null) {
variableTrace = new EObjectContainmentEList(VariableMapping.class, this, Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE);
}
return variableTrace;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE:
return ((InternalEList>)getVariableTrace()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_FULLY_QUALIFIED_NAME:
return getPatternFullyQualifiedName();
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_PQUERY:
return getPatternPQuery();
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE:
return getVariableTrace();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_FULLY_QUALIFIED_NAME:
setPatternFullyQualifiedName((String)newValue);
return;
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_PQUERY:
setPatternPQuery(newValue);
return;
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE:
getVariableTrace().clear();
getVariableTrace().addAll((Collection extends VariableMapping>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_FULLY_QUALIFIED_NAME:
setPatternFullyQualifiedName(PATTERN_FULLY_QUALIFIED_NAME_EDEFAULT);
return;
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_PQUERY:
setPatternPQuery(PATTERN_PQUERY_EDEFAULT);
return;
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE:
getVariableTrace().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_FULLY_QUALIFIED_NAME:
return PATTERN_FULLY_QUALIFIED_NAME_EDEFAULT == null ? patternFullyQualifiedName != null : !PATTERN_FULLY_QUALIFIED_NAME_EDEFAULT.equals(patternFullyQualifiedName);
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__PATTERN_PQUERY:
return PATTERN_PQUERY_EDEFAULT == null ? patternPQuery != null : !PATTERN_PQUERY_EDEFAULT.equals(patternPQuery);
case Viatra2LogicAnnotationsPackage.TRANSFOMED_VIATRA_QUERY__VARIABLE_TRACE:
return variableTrace != null && !variableTrace.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (patternFullyQualifiedName: ");
result.append(patternFullyQualifiedName);
result.append(", patternPQuery: ");
result.append(patternPQuery);
result.append(')');
return result.toString();
}
} //TransfomedViatraQueryImpl