/**
*
*
*
* $Id$
*/
package net.opengis.ows11.impl;
import java.util.Collection;
import net.opengis.ows11.CodeType;
import net.opengis.ows11.KeywordsType;
import net.opengis.ows11.LanguageStringType;
import net.opengis.ows11.Ows11Package;
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.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Keywords Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.ows11.impl.KeywordsTypeImpl#getKeyword Keyword}
* - {@link net.opengis.ows11.impl.KeywordsTypeImpl#getType Type}
*
*
*
* @generated
*/
public class KeywordsTypeImpl extends EObjectImpl implements KeywordsType {
/**
* The cached value of the '{@link #getKeyword() Keyword}' containment reference list.
*
*
* @see #getKeyword()
* @generated
* @ordered
*/
protected EList keyword;
/**
* The cached value of the '{@link #getType() Type}' containment reference.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected CodeType type;
/**
*
*
* @generated
*/
protected KeywordsTypeImpl() {
super();
}
/**
*
*
* @generated
*/
protected EClass eStaticClass() {
return Ows11Package.Literals.KEYWORDS_TYPE;
}
/**
*
*
* @generated
*/
public EList getKeyword() {
if (keyword == null) {
keyword = new EObjectContainmentEList(LanguageStringType.class, this, Ows11Package.KEYWORDS_TYPE__KEYWORD);
}
return keyword;
}
/**
*
*
* @generated
*/
public CodeType getType() {
return type;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetType(CodeType newType, NotificationChain msgs) {
CodeType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Ows11Package.KEYWORDS_TYPE__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setType(CodeType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Ows11Package.KEYWORDS_TYPE__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Ows11Package.KEYWORDS_TYPE__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ows11Package.KEYWORDS_TYPE__TYPE, newType, newType));
}
/**
*
*
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Ows11Package.KEYWORDS_TYPE__KEYWORD:
return ((InternalEList)getKeyword()).basicRemove(otherEnd, msgs);
case Ows11Package.KEYWORDS_TYPE__TYPE:
return basicSetType(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Ows11Package.KEYWORDS_TYPE__KEYWORD:
return getKeyword();
case Ows11Package.KEYWORDS_TYPE__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Ows11Package.KEYWORDS_TYPE__KEYWORD:
getKeyword().clear();
getKeyword().addAll((Collection)newValue);
return;
case Ows11Package.KEYWORDS_TYPE__TYPE:
setType((CodeType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case Ows11Package.KEYWORDS_TYPE__KEYWORD:
getKeyword().clear();
return;
case Ows11Package.KEYWORDS_TYPE__TYPE:
setType((CodeType)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case Ows11Package.KEYWORDS_TYPE__KEYWORD:
return keyword != null && !keyword.isEmpty();
case Ows11Package.KEYWORDS_TYPE__TYPE:
return type != null;
}
return super.eIsSet(featureID);
}
} //KeywordsTypeImpl