/**
* <copyright>
* </copyright>
*
* $Id: FilterExpressionImpl.java,v 1.3 2011/04/18 08:29:42 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.core.dom.impl;
import org.eclipse.dltk.javascript.core.dom.DomPackage;
import org.eclipse.dltk.javascript.core.dom.Expression;
import org.eclipse.dltk.javascript.core.dom.FilterExpression;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Filter Expression</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.dltk.javascript.core.dom.impl.FilterExpressionImpl#getObject <em>Object</em>}</li>
* <li>{@link org.eclipse.dltk.javascript.core.dom.impl.FilterExpressionImpl#getFilter <em>Filter</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class FilterExpressionImpl extends ExpressionImpl implements FilterExpression {
/**
* The cached value of the '{@link #getObject() <em>Object</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObject()
* @generated
* @ordered
*/
protected Expression object;
/**
* The cached value of the '{@link #getFilter() <em>Filter</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFilter()
* @generated
* @ordered
*/
protected Expression filter;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FilterExpressionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.FILTER_EXPRESSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getObject() {
return object;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetObject(Expression newObject, NotificationChain msgs) {
Expression oldObject = object;
object = newObject;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.FILTER_EXPRESSION__OBJECT, oldObject, newObject);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setObject(Expression newObject) {
if (newObject != object) {
NotificationChain msgs = null;
if (object != null)
msgs = ((InternalEObject)object).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.FILTER_EXPRESSION__OBJECT, null, msgs);
if (newObject != null)
msgs = ((InternalEObject)newObject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.FILTER_EXPRESSION__OBJECT, null, msgs);
msgs = basicSetObject(newObject, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.FILTER_EXPRESSION__OBJECT, newObject, newObject));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getFilter() {
return filter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFilter(Expression newFilter, NotificationChain msgs) {
Expression oldFilter = filter;
filter = newFilter;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.FILTER_EXPRESSION__FILTER, oldFilter, newFilter);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFilter(Expression newFilter) {
if (newFilter != filter) {
NotificationChain msgs = null;
if (filter != null)
msgs = ((InternalEObject)filter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.FILTER_EXPRESSION__FILTER, null, msgs);
if (newFilter != null)
msgs = ((InternalEObject)newFilter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.FILTER_EXPRESSION__FILTER, null, msgs);
msgs = basicSetFilter(newFilter, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.FILTER_EXPRESSION__FILTER, newFilter, newFilter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.FILTER_EXPRESSION__OBJECT:
return basicSetObject(null, msgs);
case DomPackage.FILTER_EXPRESSION__FILTER:
return basicSetFilter(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.FILTER_EXPRESSION__OBJECT:
return getObject();
case DomPackage.FILTER_EXPRESSION__FILTER:
return getFilter();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.FILTER_EXPRESSION__OBJECT:
setObject((Expression)newValue);
return;
case DomPackage.FILTER_EXPRESSION__FILTER:
setFilter((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.FILTER_EXPRESSION__OBJECT:
setObject((Expression)null);
return;
case DomPackage.FILTER_EXPRESSION__FILTER:
setFilter((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.FILTER_EXPRESSION__OBJECT:
return object != null;
case DomPackage.FILTER_EXPRESSION__FILTER:
return filter != null;
}
return super.eIsSet(featureID);
}
} //FilterExpressionImpl