/**
* <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.Chunk;
import edu.isistan.uima.unified.typesystems.nlp.NLPPackage;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chunk</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link edu.isistan.uima.unified.typesystems.nlp.impl.ChunkImpl#getChunk <em>Chunk</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ChunkImpl extends IdentifiableAnnotationImpl implements Chunk {
/**
* The default value of the '{@link #getChunk() <em>Chunk</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChunk()
* @generated
* @ordered
*/
protected static final String CHUNK_EDEFAULT = null;
/**
* The cached value of the '{@link #getChunk() <em>Chunk</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChunk()
* @generated
* @ordered
*/
protected String chunk = CHUNK_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ChunkImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return NLPPackage.Literals.CHUNK;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getChunk() {
return chunk;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setChunk(String newChunk) {
String oldChunk = chunk;
chunk = newChunk;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NLPPackage.CHUNK__CHUNK, oldChunk, chunk));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case NLPPackage.CHUNK__CHUNK:
return getChunk();
}
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.CHUNK__CHUNK:
setChunk((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NLPPackage.CHUNK__CHUNK:
setChunk(CHUNK_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NLPPackage.CHUNK__CHUNK:
return CHUNK_EDEFAULT == null ? chunk != null : !CHUNK_EDEFAULT.equals(chunk);
}
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(" (chunk: ");
result.append(chunk);
result.append(')');
return result.toString();
}
} //ChunkImpl