/**
*
*
*
* $Id$
*/
package net.opengis.fes20.impl;
import javax.xml.namespace.QName;
import net.opengis.fes20.Fes20Package;
import net.opengis.fes20.LiteralType;
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;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Literal Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.fes20.impl.LiteralTypeImpl#getMixed Mixed}
* - {@link net.opengis.fes20.impl.LiteralTypeImpl#getAny Any}
* - {@link net.opengis.fes20.impl.LiteralTypeImpl#getType Type}
*
*
*
* @generated
*/
public class LiteralTypeImpl extends EObjectImpl implements LiteralType {
/**
* The cached value of the '{@link #getMixed() Mixed}' attribute list.
*
*
* @see #getMixed()
* @generated
* @ordered
*/
protected FeatureMap mixed;
/**
* The default value of the '{@link #getType() Type}' attribute.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected static final QName TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() Type}' attribute.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected QName type = TYPE_EDEFAULT;
/**
*
*
* @generated
*/
protected LiteralTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Fes20Package.Literals.LITERAL_TYPE;
}
/**
*
*
* @generated
*/
public FeatureMap getMixed() {
if (mixed == null) {
mixed = new BasicFeatureMap(this, Fes20Package.LITERAL_TYPE__MIXED);
}
return mixed;
}
/**
*
*
* @generated
*/
public FeatureMap getAny() {
return (FeatureMap)getMixed().list(Fes20Package.Literals.LITERAL_TYPE__ANY);
}
/**
*
*
* @generated
*/
public QName getType() {
return type;
}
/**
*
*
* @generated
*/
public void setType(QName newType) {
QName oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.LITERAL_TYPE__TYPE, oldType, type));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Fes20Package.LITERAL_TYPE__MIXED:
return ((InternalEList>)getMixed()).basicRemove(otherEnd, msgs);
case Fes20Package.LITERAL_TYPE__ANY:
return ((InternalEList>)getAny()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Fes20Package.LITERAL_TYPE__MIXED:
if (coreType) return getMixed();
return ((FeatureMap.Internal)getMixed()).getWrapper();
case Fes20Package.LITERAL_TYPE__ANY:
if (coreType) return getAny();
return ((FeatureMap.Internal)getAny()).getWrapper();
case Fes20Package.LITERAL_TYPE__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Fes20Package.LITERAL_TYPE__MIXED:
((FeatureMap.Internal)getMixed()).set(newValue);
return;
case Fes20Package.LITERAL_TYPE__ANY:
((FeatureMap.Internal)getAny()).set(newValue);
return;
case Fes20Package.LITERAL_TYPE__TYPE:
setType((QName)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Fes20Package.LITERAL_TYPE__MIXED:
getMixed().clear();
return;
case Fes20Package.LITERAL_TYPE__ANY:
getAny().clear();
return;
case Fes20Package.LITERAL_TYPE__TYPE:
setType(TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Fes20Package.LITERAL_TYPE__MIXED:
return mixed != null && !mixed.isEmpty();
case Fes20Package.LITERAL_TYPE__ANY:
return !getAny().isEmpty();
case Fes20Package.LITERAL_TYPE__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (mixed: ");
result.append(mixed);
result.append(", type: ");
result.append(type);
result.append(')');
return result.toString();
}
} //LiteralTypeImpl