/**
*
*
*
* $Id$
*/
package net.opengis.fes20.impl;
import net.opengis.fes20.Fes20Package;
import net.opengis.fes20.SortOrderType;
import net.opengis.fes20.SortPropertyType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
/**
*
* An implementation of the model object 'Sort Property Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.fes20.impl.SortPropertyTypeImpl#getValueReference Value Reference}
* - {@link net.opengis.fes20.impl.SortPropertyTypeImpl#getSortOrder Sort Order}
*
*
*
* @generated
*/
public class SortPropertyTypeImpl extends EObjectImpl implements SortPropertyType {
/**
* The default value of the '{@link #getValueReference() Value Reference}' attribute.
*
*
* @see #getValueReference()
* @generated
* @ordered
*/
protected static final String VALUE_REFERENCE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValueReference() Value Reference}' attribute.
*
*
* @see #getValueReference()
* @generated
* @ordered
*/
protected String valueReference = VALUE_REFERENCE_EDEFAULT;
/**
* The default value of the '{@link #getSortOrder() Sort Order}' attribute.
*
*
* @see #getSortOrder()
* @generated
* @ordered
*/
protected static final SortOrderType SORT_ORDER_EDEFAULT = SortOrderType.DESC;
/**
* The cached value of the '{@link #getSortOrder() Sort Order}' attribute.
*
*
* @see #getSortOrder()
* @generated
* @ordered
*/
protected SortOrderType sortOrder = SORT_ORDER_EDEFAULT;
/**
* This is true if the Sort Order attribute has been set.
*
*
* @generated
* @ordered
*/
protected boolean sortOrderESet;
/**
*
*
* @generated
*/
protected SortPropertyTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Fes20Package.Literals.SORT_PROPERTY_TYPE;
}
/**
*
*
* @generated
*/
public String getValueReference() {
return valueReference;
}
/**
*
*
* @generated
*/
public void setValueReference(String newValueReference) {
String oldValueReference = valueReference;
valueReference = newValueReference;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.SORT_PROPERTY_TYPE__VALUE_REFERENCE, oldValueReference, valueReference));
}
/**
*
*
* @generated
*/
public SortOrderType getSortOrder() {
return sortOrder;
}
/**
*
*
* @generated
*/
public void setSortOrder(SortOrderType newSortOrder) {
SortOrderType oldSortOrder = sortOrder;
sortOrder = newSortOrder == null ? SORT_ORDER_EDEFAULT : newSortOrder;
boolean oldSortOrderESet = sortOrderESet;
sortOrderESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER, oldSortOrder, sortOrder, !oldSortOrderESet));
}
/**
*
*
* @generated
*/
public void unsetSortOrder() {
SortOrderType oldSortOrder = sortOrder;
boolean oldSortOrderESet = sortOrderESet;
sortOrder = SORT_ORDER_EDEFAULT;
sortOrderESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER, oldSortOrder, SORT_ORDER_EDEFAULT, oldSortOrderESet));
}
/**
*
*
* @generated
*/
public boolean isSetSortOrder() {
return sortOrderESet;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Fes20Package.SORT_PROPERTY_TYPE__VALUE_REFERENCE:
return getValueReference();
case Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER:
return getSortOrder();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Fes20Package.SORT_PROPERTY_TYPE__VALUE_REFERENCE:
setValueReference((String)newValue);
return;
case Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER:
setSortOrder((SortOrderType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Fes20Package.SORT_PROPERTY_TYPE__VALUE_REFERENCE:
setValueReference(VALUE_REFERENCE_EDEFAULT);
return;
case Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER:
unsetSortOrder();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Fes20Package.SORT_PROPERTY_TYPE__VALUE_REFERENCE:
return VALUE_REFERENCE_EDEFAULT == null ? valueReference != null : !VALUE_REFERENCE_EDEFAULT.equals(valueReference);
case Fes20Package.SORT_PROPERTY_TYPE__SORT_ORDER:
return isSetSortOrder();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (valueReference: ");
result.append(valueReference);
result.append(", sortOrder: ");
if (sortOrderESet) result.append(sortOrder); else result.append("");
result.append(')');
return result.toString();
}
} //SortPropertyTypeImpl