kieker.model.collection.impl.CouplingImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kieker Show documentation
Show all versions of kieker Show documentation
Kieker: Application Performance Monitoring and Dynamic Software Analysis
The newest version!
/**
*/
package kieker.model.collection.impl;
import java.lang.reflect.InvocationTargetException;
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.impl.MinimalEObjectImpl;
import kieker.model.analysismodel.type.ComponentType;
import kieker.model.collection.CollectionPackage;
import kieker.model.collection.Coupling;
/**
*
* An implementation of the model object 'Coupling'.
*
*
* The following features are implemented:
*
*
* - {@link kieker.model.collection.impl.CouplingImpl#getRequired Required}
* - {@link kieker.model.collection.impl.CouplingImpl#getProvided Provided}
*
*
* @generated
*/
public class CouplingImpl extends MinimalEObjectImpl.Container implements Coupling {
/**
* The cached value of the '{@link #getRequired() Required}' reference.
*
*
* @see #getRequired()
* @generated
* @ordered
*/
protected ComponentType required;
/**
* The cached value of the '{@link #getProvided() Provided}' reference.
*
*
* @see #getProvided()
* @generated
* @ordered
*/
protected ComponentType provided;
/**
*
*
* @generated
*/
protected CouplingImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CollectionPackage.Literals.COUPLING;
}
/**
*
*
* @generated
*/
@Override
public ComponentType getRequired() {
if (required != null && required.eIsProxy()) {
InternalEObject oldRequired = (InternalEObject)required;
required = (ComponentType)eResolveProxy(oldRequired);
if (required != oldRequired) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CollectionPackage.COUPLING__REQUIRED, oldRequired, required));
}
}
return required;
}
/**
*
*
* @generated
*/
public ComponentType basicGetRequired() {
return required;
}
/**
*
*
* @generated
*/
@Override
public void setRequired(ComponentType newRequired) {
ComponentType oldRequired = required;
required = newRequired;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CollectionPackage.COUPLING__REQUIRED, oldRequired, required));
}
/**
*
*
* @generated
*/
@Override
public ComponentType getProvided() {
if (provided != null && provided.eIsProxy()) {
InternalEObject oldProvided = (InternalEObject)provided;
provided = (ComponentType)eResolveProxy(oldProvided);
if (provided != oldProvided) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CollectionPackage.COUPLING__PROVIDED, oldProvided, provided));
}
}
return provided;
}
/**
*
*
* @generated
*/
public ComponentType basicGetProvided() {
return provided;
}
/**
*
*
* @generated
*/
@Override
public void setProvided(ComponentType newProvided) {
ComponentType oldProvided = provided;
provided = newProvided;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CollectionPackage.COUPLING__PROVIDED, oldProvided, provided));
}
/**
*
*
* @generated
*/
@Override
public boolean equals(final Object value) {
if (value != null) {
if (value instanceof Coupling) {
final Coupling coupling = (Coupling) value;
if (this.required == null && coupling.getRequired() == null) {
if (this.provided == null && coupling.getProvided() == null) {
return true;
} else if (this.provided != null && coupling.getProvided() != null) {
return this.provided.equals(coupling.getProvided());
}
} else if (this.required != null && coupling.getRequired() != null) {
if (this.provided == null && coupling.getProvided() == null) {
return this.required.equals(coupling.getRequired()) ;
} else if (this.provided != null && coupling.getProvided() != null) {
return this.required.equals(coupling.getRequired()) && this.provided.equals(coupling.getProvided());
}
}
}
}
return false;
}
/**
*
*
* @generated
*/
@Override
public int hashCode() {
return (this.required == null ? 0 : this.required.hashCode()) ^ (this.provided == null ? 0 : this.provided.hashCode());
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CollectionPackage.COUPLING__REQUIRED:
if (resolve) return getRequired();
return basicGetRequired();
case CollectionPackage.COUPLING__PROVIDED:
if (resolve) return getProvided();
return basicGetProvided();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CollectionPackage.COUPLING__REQUIRED:
setRequired((ComponentType)newValue);
return;
case CollectionPackage.COUPLING__PROVIDED:
setProvided((ComponentType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CollectionPackage.COUPLING__REQUIRED:
setRequired((ComponentType)null);
return;
case CollectionPackage.COUPLING__PROVIDED:
setProvided((ComponentType)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CollectionPackage.COUPLING__REQUIRED:
return required != null;
case CollectionPackage.COUPLING__PROVIDED:
return provided != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException {
switch (operationID) {
case CollectionPackage.COUPLING___EQUALS__OBJECT:
return equals(arguments.get(0));
case CollectionPackage.COUPLING___HASH_CODE:
return hashCode();
}
return super.eInvoke(operationID, arguments);
}
} // CouplingImpl
© 2015 - 2024 Weber Informatics LLC | Privacy Policy