/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.objectmodel.relationships.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import orgomg.cwm.objectmodel.core.impl.StructuralFeatureImpl;
import orgomg.cwm.objectmodel.relationships.AggregationKind;
import orgomg.cwm.objectmodel.relationships.AssociationEnd;
import orgomg.cwm.objectmodel.relationships.RelationshipsPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Association End</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link orgomg.cwm.objectmodel.relationships.impl.AssociationEndImpl#getAggregation <em>Aggregation</em>}</li>
* <li>{@link orgomg.cwm.objectmodel.relationships.impl.AssociationEndImpl#isIsNavigable <em>Is Navigable</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AssociationEndImpl extends StructuralFeatureImpl implements AssociationEnd {
/**
* The default value of the '{@link #getAggregation() <em>Aggregation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAggregation()
* @generated
* @ordered
*/
protected static final AggregationKind AGGREGATION_EDEFAULT = AggregationKind.AK_NONE;
/**
* The cached value of the '{@link #getAggregation() <em>Aggregation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAggregation()
* @generated
* @ordered
*/
protected AggregationKind aggregation = AGGREGATION_EDEFAULT;
/**
* The default value of the '{@link #isIsNavigable() <em>Is Navigable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsNavigable()
* @generated
* @ordered
*/
protected static final boolean IS_NAVIGABLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsNavigable() <em>Is Navigable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsNavigable()
* @generated
* @ordered
*/
protected boolean isNavigable = IS_NAVIGABLE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AssociationEndImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RelationshipsPackage.Literals.ASSOCIATION_END;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AggregationKind getAggregation() {
return aggregation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAggregation(AggregationKind newAggregation) {
AggregationKind oldAggregation = aggregation;
aggregation = newAggregation == null ? AGGREGATION_EDEFAULT : newAggregation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RelationshipsPackage.ASSOCIATION_END__AGGREGATION, oldAggregation, aggregation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsNavigable() {
return isNavigable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsNavigable(boolean newIsNavigable) {
boolean oldIsNavigable = isNavigable;
isNavigable = newIsNavigable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RelationshipsPackage.ASSOCIATION_END__IS_NAVIGABLE, oldIsNavigable, isNavigable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RelationshipsPackage.ASSOCIATION_END__AGGREGATION:
return getAggregation();
case RelationshipsPackage.ASSOCIATION_END__IS_NAVIGABLE:
return isIsNavigable();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RelationshipsPackage.ASSOCIATION_END__AGGREGATION:
setAggregation((AggregationKind)newValue);
return;
case RelationshipsPackage.ASSOCIATION_END__IS_NAVIGABLE:
setIsNavigable((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RelationshipsPackage.ASSOCIATION_END__AGGREGATION:
setAggregation(AGGREGATION_EDEFAULT);
return;
case RelationshipsPackage.ASSOCIATION_END__IS_NAVIGABLE:
setIsNavigable(IS_NAVIGABLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RelationshipsPackage.ASSOCIATION_END__AGGREGATION:
return aggregation != AGGREGATION_EDEFAULT;
case RelationshipsPackage.ASSOCIATION_END__IS_NAVIGABLE:
return isNavigable != IS_NAVIGABLE_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(" (aggregation: ");
result.append(aggregation);
result.append(", isNavigable: ");
result.append(isNavigable);
result.append(')');
return result.toString();
}
} //AssociationEndImpl