/** * <copyright> * </copyright> * * $Id$ */ package edu.isistan.uima.unified.typesystems.srl.impl; import edu.isistan.uima.unified.typesystems.impl.IdentifiableAnnotationImpl; import edu.isistan.uima.unified.typesystems.nlp.Token; import edu.isistan.uima.unified.typesystems.srl.Argument; import edu.isistan.uima.unified.typesystems.srl.Predicate; import edu.isistan.uima.unified.typesystems.srl.SRLPackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; 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.util.EObjectResolvingEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Predicate</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#getLabel <em>Label</em>}</li> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#getDescription <em>Description</em>}</li> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#getRoot <em>Root</em>}</li> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#getKind <em>Kind</em>}</li> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#isPassiveVoice <em>Passive Voice</em>}</li> * <li>{@link edu.isistan.uima.unified.typesystems.srl.impl.PredicateImpl#getArguments <em>Arguments</em>}</li> * </ul> * </p> * * @generated */ public class PredicateImpl extends IdentifiableAnnotationImpl implements Predicate { /** * The default value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected static final String LABEL_EDEFAULT = null; /** * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected String label = LABEL_EDEFAULT; /** * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The cached value of the '{@link #getRoot() <em>Root</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRoot() * @generated * @ordered */ protected Token root; /** * The default value of the '{@link #getKind() <em>Kind</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getKind() * @generated * @ordered */ protected static final String KIND_EDEFAULT = null; /** * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getKind() * @generated * @ordered */ protected String kind = KIND_EDEFAULT; /** * The default value of the '{@link #isPassiveVoice() <em>Passive Voice</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isPassiveVoice() * @generated * @ordered */ protected static final boolean PASSIVE_VOICE_EDEFAULT = false; /** * The cached value of the '{@link #isPassiveVoice() <em>Passive Voice</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isPassiveVoice() * @generated * @ordered */ protected boolean passiveVoice = PASSIVE_VOICE_EDEFAULT; /** * The cached value of the '{@link #getArguments() <em>Arguments</em>}' reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getArguments() * @generated * @ordered */ protected EList<Argument> arguments; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PredicateImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return SRLPackage.Literals.PREDICATE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLabel() { return label; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLabel(String newLabel) { String oldLabel = label; label = newLabel; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SRLPackage.PREDICATE__LABEL, oldLabel, label)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getDescription() { return description; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SRLPackage.PREDICATE__DESCRIPTION, oldDescription, description)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Token getRoot() { if (root != null && root.eIsProxy()) { InternalEObject oldRoot = (InternalEObject)root; root = (Token)eResolveProxy(oldRoot); if (root != oldRoot) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, SRLPackage.PREDICATE__ROOT, oldRoot, root)); } } return root; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Token basicGetRoot() { return root; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRoot(Token newRoot) { Token oldRoot = root; root = newRoot; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SRLPackage.PREDICATE__ROOT, oldRoot, root)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getKind() { return kind; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setKind(String newKind) { String oldKind = kind; kind = newKind; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SRLPackage.PREDICATE__KIND, oldKind, kind)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isPassiveVoice() { return passiveVoice; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setPassiveVoice(boolean newPassiveVoice) { boolean oldPassiveVoice = passiveVoice; passiveVoice = newPassiveVoice; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SRLPackage.PREDICATE__PASSIVE_VOICE, oldPassiveVoice, passiveVoice)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Argument> getArguments() { if (arguments == null) { arguments = new EObjectResolvingEList<Argument>(Argument.class, this, SRLPackage.PREDICATE__ARGUMENTS); } return arguments; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SRLPackage.PREDICATE__LABEL: return getLabel(); case SRLPackage.PREDICATE__DESCRIPTION: return getDescription(); case SRLPackage.PREDICATE__ROOT: if (resolve) return getRoot(); return basicGetRoot(); case SRLPackage.PREDICATE__KIND: return getKind(); case SRLPackage.PREDICATE__PASSIVE_VOICE: return isPassiveVoice(); case SRLPackage.PREDICATE__ARGUMENTS: return getArguments(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SRLPackage.PREDICATE__LABEL: setLabel((String)newValue); return; case SRLPackage.PREDICATE__DESCRIPTION: setDescription((String)newValue); return; case SRLPackage.PREDICATE__ROOT: setRoot((Token)newValue); return; case SRLPackage.PREDICATE__KIND: setKind((String)newValue); return; case SRLPackage.PREDICATE__PASSIVE_VOICE: setPassiveVoice((Boolean)newValue); return; case SRLPackage.PREDICATE__ARGUMENTS: getArguments().clear(); getArguments().addAll((Collection<? extends Argument>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SRLPackage.PREDICATE__LABEL: setLabel(LABEL_EDEFAULT); return; case SRLPackage.PREDICATE__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case SRLPackage.PREDICATE__ROOT: setRoot((Token)null); return; case SRLPackage.PREDICATE__KIND: setKind(KIND_EDEFAULT); return; case SRLPackage.PREDICATE__PASSIVE_VOICE: setPassiveVoice(PASSIVE_VOICE_EDEFAULT); return; case SRLPackage.PREDICATE__ARGUMENTS: getArguments().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SRLPackage.PREDICATE__LABEL: return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); case SRLPackage.PREDICATE__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case SRLPackage.PREDICATE__ROOT: return root != null; case SRLPackage.PREDICATE__KIND: return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind); case SRLPackage.PREDICATE__PASSIVE_VOICE: return passiveVoice != PASSIVE_VOICE_EDEFAULT; case SRLPackage.PREDICATE__ARGUMENTS: return arguments != null && !arguments.isEmpty(); } 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(" (label: "); result.append(label); result.append(", description: "); result.append(description); result.append(", kind: "); result.append(kind); result.append(", passiveVoice: "); result.append(passiveVoice); result.append(')'); return result.toString(); } } //PredicateImpl