/**
*/
package Subset0267.impl;
import Subset0267.Subset0267Package;
import Subset0267.TLength;
import Subset0267.TTlgVar;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>TTlg Var</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link Subset0267.impl.TTlgVarImpl#getComment <em>Comment</em>}</li>
* <li>{@link Subset0267.impl.TTlgVarImpl#getLength <em>Length</em>}</li>
* <li>{@link Subset0267.impl.TTlgVarImpl#getName <em>Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TTlgVarImpl extends MinimalEObjectImpl.Container implements TTlgVar {
/**
* The default value of the '{@link #getComment() <em>Comment</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComment()
* @generated
* @ordered
*/
protected static final String COMMENT_EDEFAULT = null;
/**
* The cached value of the '{@link #getComment() <em>Comment</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComment()
* @generated
* @ordered
*/
protected String comment = COMMENT_EDEFAULT;
/**
* The default value of the '{@link #getLength() <em>Length</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLength()
* @generated
* @ordered
*/
protected static final TLength LENGTH_EDEFAULT = TLength._;
/**
* The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLength()
* @generated
* @ordered
*/
protected TLength length = LENGTH_EDEFAULT;
/**
* This is true if the Length attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean lengthESet;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TTlgVarImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Subset0267Package.Literals.TTLG_VAR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getComment() {
return comment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setComment(String newComment) {
String oldComment = comment;
comment = newComment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Subset0267Package.TTLG_VAR__COMMENT, oldComment, comment));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TLength getLength() {
return length;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLength(TLength newLength) {
TLength oldLength = length;
length = newLength == null ? LENGTH_EDEFAULT : newLength;
boolean oldLengthESet = lengthESet;
lengthESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Subset0267Package.TTLG_VAR__LENGTH, oldLength, length, !oldLengthESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetLength() {
TLength oldLength = length;
boolean oldLengthESet = lengthESet;
length = LENGTH_EDEFAULT;
lengthESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, Subset0267Package.TTLG_VAR__LENGTH, oldLength, LENGTH_EDEFAULT, oldLengthESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetLength() {
return lengthESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Subset0267Package.TTLG_VAR__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Subset0267Package.TTLG_VAR__COMMENT:
return getComment();
case Subset0267Package.TTLG_VAR__LENGTH:
return getLength();
case Subset0267Package.TTLG_VAR__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Subset0267Package.TTLG_VAR__COMMENT:
setComment((String)newValue);
return;
case Subset0267Package.TTLG_VAR__LENGTH:
setLength((TLength)newValue);
return;
case Subset0267Package.TTLG_VAR__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Subset0267Package.TTLG_VAR__COMMENT:
setComment(COMMENT_EDEFAULT);
return;
case Subset0267Package.TTLG_VAR__LENGTH:
unsetLength();
return;
case Subset0267Package.TTLG_VAR__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Subset0267Package.TTLG_VAR__COMMENT:
return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
case Subset0267Package.TTLG_VAR__LENGTH:
return isSetLength();
case Subset0267Package.TTLG_VAR__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
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(" (comment: ");
result.append(comment);
result.append(", length: ");
if (lengthESet) result.append(length); else result.append("<unset>");
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //TTlgVarImpl