/**
* <copyright>
* </copyright>
*
* $Id$
*/
package edu.isistan.uima.unified.typesystems.nlp.impl;
import edu.isistan.uima.unified.typesystems.impl.IdentifiableAnnotationImpl;
import edu.isistan.uima.unified.typesystems.nlp.CoNLLDependency;
import edu.isistan.uima.unified.typesystems.nlp.NLPPackage;
import edu.isistan.uima.unified.typesystems.nlp.Token;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Co NLL Dependency</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link edu.isistan.uima.unified.typesystems.nlp.impl.CoNLLDependencyImpl#getRelation <em>Relation</em>}</li>
* <li>{@link edu.isistan.uima.unified.typesystems.nlp.impl.CoNLLDependencyImpl#getSource <em>Source</em>}</li>
* <li>{@link edu.isistan.uima.unified.typesystems.nlp.impl.CoNLLDependencyImpl#getTarget <em>Target</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CoNLLDependencyImpl extends IdentifiableAnnotationImpl implements CoNLLDependency {
/**
* The default value of the '{@link #getRelation() <em>Relation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRelation()
* @generated
* @ordered
*/
protected static final String RELATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getRelation() <em>Relation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRelation()
* @generated
* @ordered
*/
protected String relation = RELATION_EDEFAULT;
/**
* The cached value of the '{@link #getSource() <em>Source</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSource()
* @generated
* @ordered
*/
protected Token source;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected Token target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CoNLLDependencyImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return NLPPackage.Literals.CO_NLL_DEPENDENCY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getRelation() {
return relation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRelation(String newRelation) {
String oldRelation = relation;
relation = newRelation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NLPPackage.CO_NLL_DEPENDENCY__RELATION, oldRelation, relation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Token getSource() {
if (source != null && source.eIsProxy()) {
InternalEObject oldSource = (InternalEObject)source;
source = (Token)eResolveProxy(oldSource);
if (source != oldSource) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, NLPPackage.CO_NLL_DEPENDENCY__SOURCE, oldSource, source));
}
}
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Token basicGetSource() {
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSource(Token newSource) {
Token oldSource = source;
source = newSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NLPPackage.CO_NLL_DEPENDENCY__SOURCE, oldSource, source));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Token getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (Token)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, NLPPackage.CO_NLL_DEPENDENCY__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Token basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(Token newTarget) {
Token oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NLPPackage.CO_NLL_DEPENDENCY__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case NLPPackage.CO_NLL_DEPENDENCY__RELATION:
return getRelation();
case NLPPackage.CO_NLL_DEPENDENCY__SOURCE:
if (resolve) return getSource();
return basicGetSource();
case NLPPackage.CO_NLL_DEPENDENCY__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case NLPPackage.CO_NLL_DEPENDENCY__RELATION:
setRelation((String)newValue);
return;
case NLPPackage.CO_NLL_DEPENDENCY__SOURCE:
setSource((Token)newValue);
return;
case NLPPackage.CO_NLL_DEPENDENCY__TARGET:
setTarget((Token)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NLPPackage.CO_NLL_DEPENDENCY__RELATION:
setRelation(RELATION_EDEFAULT);
return;
case NLPPackage.CO_NLL_DEPENDENCY__SOURCE:
setSource((Token)null);
return;
case NLPPackage.CO_NLL_DEPENDENCY__TARGET:
setTarget((Token)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NLPPackage.CO_NLL_DEPENDENCY__RELATION:
return RELATION_EDEFAULT == null ? relation != null : !RELATION_EDEFAULT.equals(relation);
case NLPPackage.CO_NLL_DEPENDENCY__SOURCE:
return source != null;
case NLPPackage.CO_NLL_DEPENDENCY__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (relation: ");
result.append(relation);
result.append(')');
return result.toString();
}
} //CoNLLDependencyImpl