/**
* <copyright>
* </copyright>
*
* $Id$
*/
package OntoUML.impl;
import OntoUML.OntoUMLPackage;
import OntoUML.RedefinableElement;
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>Redefinable Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link OntoUML.impl.RedefinableElementImpl#isIsLeaf <em>Is Leaf</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RedefinableElementImpl extends NamedElementImpl implements RedefinableElement {
/**
* The default value of the '{@link #isIsLeaf() <em>Is Leaf</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsLeaf()
* @generated
* @ordered
*/
protected static final boolean IS_LEAF_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsLeaf() <em>Is Leaf</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsLeaf()
* @generated
* @ordered
*/
protected boolean isLeaf = IS_LEAF_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RedefinableElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OntoUMLPackage.Literals.REDEFINABLE_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsLeaf() {
return isLeaf;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsLeaf(boolean newIsLeaf) {
boolean oldIsLeaf = isLeaf;
isLeaf = newIsLeaf;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OntoUMLPackage.REDEFINABLE_ELEMENT__IS_LEAF, oldIsLeaf, isLeaf));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case OntoUMLPackage.REDEFINABLE_ELEMENT__IS_LEAF:
return isIsLeaf() ? Boolean.TRUE : Boolean.FALSE;
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OntoUMLPackage.REDEFINABLE_ELEMENT__IS_LEAF:
setIsLeaf(((Boolean)newValue).booleanValue());
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OntoUMLPackage.REDEFINABLE_ELEMENT__IS_LEAF:
setIsLeaf(IS_LEAF_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OntoUMLPackage.REDEFINABLE_ELEMENT__IS_LEAF:
return isLeaf != IS_LEAF_EDEFAULT;
}
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(" (isLeaf: ");
result.append(isLeaf);
result.append(')');
return result.toString();
}
} //RedefinableElementImpl