/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.emf4sw.owl.impl;
import org.eclipse.emf.common.notify.Notification;
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.MinimalEObjectImpl;
import com.emf4sw.owl.DataRange;
import com.emf4sw.owl.FacetRestriction;
import com.emf4sw.owl.OWLPackage;
import com.emf4sw.rdf.Literal;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Facet Restriction</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.emf4sw.owl.impl.FacetRestrictionImpl#getDatatype <em>Datatype</em>}</li>
* <li>{@link com.emf4sw.owl.impl.FacetRestrictionImpl#getValue <em>Value</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class FacetRestrictionImpl extends MinimalEObjectImpl.Container implements FacetRestriction {
/**
* The cached value of the '{@link #getDatatype() <em>Datatype</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDatatype()
* @generated
* @ordered
*/
protected DataRange datatype;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected Literal value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FacetRestrictionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OWLPackage.Literals.FACET_RESTRICTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataRange getDatatype() {
if (datatype != null && datatype.eIsProxy()) {
InternalEObject oldDatatype = (InternalEObject)datatype;
datatype = (DataRange)eResolveProxy(oldDatatype);
if (datatype != oldDatatype) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, OWLPackage.FACET_RESTRICTION__DATATYPE, oldDatatype, datatype));
}
}
return datatype;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataRange basicGetDatatype() {
return datatype;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDatatype(DataRange newDatatype) {
DataRange oldDatatype = datatype;
datatype = newDatatype;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OWLPackage.FACET_RESTRICTION__DATATYPE, oldDatatype, datatype));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Literal getValue() {
if (value != null && value.eIsProxy()) {
InternalEObject oldValue = (InternalEObject)value;
value = (Literal)eResolveProxy(oldValue);
if (value != oldValue) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, OWLPackage.FACET_RESTRICTION__VALUE, oldValue, value));
}
}
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Literal basicGetValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(Literal newValue) {
Literal oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OWLPackage.FACET_RESTRICTION__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case OWLPackage.FACET_RESTRICTION__DATATYPE:
if (resolve) return getDatatype();
return basicGetDatatype();
case OWLPackage.FACET_RESTRICTION__VALUE:
if (resolve) return getValue();
return basicGetValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OWLPackage.FACET_RESTRICTION__DATATYPE:
setDatatype((DataRange)newValue);
return;
case OWLPackage.FACET_RESTRICTION__VALUE:
setValue((Literal)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OWLPackage.FACET_RESTRICTION__DATATYPE:
setDatatype((DataRange)null);
return;
case OWLPackage.FACET_RESTRICTION__VALUE:
setValue((Literal)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OWLPackage.FACET_RESTRICTION__DATATYPE:
return datatype != null;
case OWLPackage.FACET_RESTRICTION__VALUE:
return value != null;
}
return super.eIsSet(featureID);
}
} //FacetRestrictionImpl