org.openxma.dsl.dom.model.impl.SelectPropertiesImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id$
*/
package org.openxma.dsl.dom.model.impl;
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;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Expression;
import org.openxma.dsl.dom.model.SelectProperties;
/**
*
* An implementation of the model object 'Select Properties'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.SelectPropertiesImpl#isDistinct Distinct}
* - {@link org.openxma.dsl.dom.model.impl.SelectPropertiesImpl#getProperties Properties}
*
*
*
* @generated
*/
public class SelectPropertiesImpl extends SelectStatementImpl implements SelectProperties {
/**
* The default value of the '{@link #isDistinct() Distinct}' attribute.
*
*
* @see #isDistinct()
* @generated
* @ordered
*/
protected static final boolean DISTINCT_EDEFAULT = false;
/**
* The cached value of the '{@link #isDistinct() Distinct}' attribute.
*
*
* @see #isDistinct()
* @generated
* @ordered
*/
protected boolean distinct = DISTINCT_EDEFAULT;
/**
* The cached value of the '{@link #getProperties() Properties}' containment reference list.
*
*
* @see #getProperties()
* @generated
* @ordered
*/
protected EList properties;
/**
*
*
* @generated
*/
protected SelectPropertiesImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.SELECT_PROPERTIES;
}
/**
*
*
* @generated
*/
public boolean isDistinct() {
return distinct;
}
/**
*
*
* @generated
*/
public void setDistinct(boolean newDistinct) {
boolean oldDistinct = distinct;
distinct = newDistinct;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.SELECT_PROPERTIES__DISTINCT, oldDistinct, distinct));
}
/**
*
*
* @generated
*/
public EList getProperties() {
if (properties == null) {
properties = new EObjectContainmentEList(Expression.class, this, DomPackage.SELECT_PROPERTIES__PROPERTIES);
}
return properties;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.SELECT_PROPERTIES__PROPERTIES:
return ((InternalEList)getProperties()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.SELECT_PROPERTIES__DISTINCT:
return isDistinct();
case DomPackage.SELECT_PROPERTIES__PROPERTIES:
return getProperties();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.SELECT_PROPERTIES__DISTINCT:
setDistinct((Boolean)newValue);
return;
case DomPackage.SELECT_PROPERTIES__PROPERTIES:
getProperties().clear();
getProperties().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.SELECT_PROPERTIES__DISTINCT:
setDistinct(DISTINCT_EDEFAULT);
return;
case DomPackage.SELECT_PROPERTIES__PROPERTIES:
getProperties().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.SELECT_PROPERTIES__DISTINCT:
return distinct != DISTINCT_EDEFAULT;
case DomPackage.SELECT_PROPERTIES__PROPERTIES:
return properties != null && !properties.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (distinct: ");
result.append(distinct);
result.append(')');
return result.toString();
}
} //SelectPropertiesImpl