
org.ow2.frascati.native_.impl.NativeInterfaceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of frascati-metamodel-native Show documentation
Show all versions of frascati-metamodel-native Show documentation
SCA metamodel extension for describing native libraries.
The newest version!
/**
*
*
*
* $Id$
*/
package org.ow2.frascati.native_.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.stp.sca.impl.InterfaceImpl;
import org.ow2.frascati.native_.NativeInterface;
import org.ow2.frascati.native_.NativePackage;
/**
*
* An implementation of the model object 'Interface'.
*
*
* The following features are implemented:
*
* - {@link org.ow2.frascati.native_.impl.NativeInterfaceImpl#getAny Any}
* - {@link org.ow2.frascati.native_.impl.NativeInterfaceImpl#getDescriptor Descriptor}
* - {@link org.ow2.frascati.native_.impl.NativeInterfaceImpl#getAnyAttribute Any Attribute}
*
*
*
* @generated
*/
public class NativeInterfaceImpl extends InterfaceImpl implements NativeInterface {
/**
* The cached value of the '{@link #getAny() Any}' attribute list.
*
*
* @see #getAny()
* @generated
* @ordered
*/
protected FeatureMap any;
/**
* The default value of the '{@link #getDescriptor() Descriptor}' attribute.
*
*
* @see #getDescriptor()
* @generated
* @ordered
*/
protected static final String DESCRIPTOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescriptor() Descriptor}' attribute.
*
*
* @see #getDescriptor()
* @generated
* @ordered
*/
protected String descriptor = DESCRIPTOR_EDEFAULT;
/**
* The cached value of the '{@link #getAnyAttribute() Any Attribute}' attribute list.
*
*
* @see #getAnyAttribute()
* @generated
* @ordered
*/
protected FeatureMap anyAttribute;
/**
*
*
* @generated
*/
protected NativeInterfaceImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return NativePackage.Literals.NATIVE_INTERFACE;
}
/**
*
*
* @generated
*/
public FeatureMap getAny() {
if (any == null) {
any = new BasicFeatureMap(this, NativePackage.NATIVE_INTERFACE__ANY);
}
return any;
}
/**
*
*
* @generated
*/
public FeatureMap getAnyAttribute() {
if (anyAttribute == null) {
anyAttribute = new BasicFeatureMap(this, NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE);
}
return anyAttribute;
}
/**
*
*
* @generated
*/
public String getDescriptor() {
return descriptor;
}
/**
*
*
* @generated
*/
public void setDescriptor(String newDescriptor) {
String oldDescriptor = descriptor;
descriptor = newDescriptor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NativePackage.NATIVE_INTERFACE__DESCRIPTOR, oldDescriptor, descriptor));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case NativePackage.NATIVE_INTERFACE__ANY:
return ((InternalEList>)getAny()).basicRemove(otherEnd, msgs);
case NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE:
return ((InternalEList>)getAnyAttribute()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case NativePackage.NATIVE_INTERFACE__ANY:
if (coreType) return getAny();
return ((FeatureMap.Internal)getAny()).getWrapper();
case NativePackage.NATIVE_INTERFACE__DESCRIPTOR:
return getDescriptor();
case NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE:
if (coreType) return getAnyAttribute();
return ((FeatureMap.Internal)getAnyAttribute()).getWrapper();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case NativePackage.NATIVE_INTERFACE__ANY:
((FeatureMap.Internal)getAny()).set(newValue);
return;
case NativePackage.NATIVE_INTERFACE__DESCRIPTOR:
setDescriptor((String)newValue);
return;
case NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE:
((FeatureMap.Internal)getAnyAttribute()).set(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NativePackage.NATIVE_INTERFACE__ANY:
getAny().clear();
return;
case NativePackage.NATIVE_INTERFACE__DESCRIPTOR:
setDescriptor(DESCRIPTOR_EDEFAULT);
return;
case NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE:
getAnyAttribute().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NativePackage.NATIVE_INTERFACE__ANY:
return any != null && !any.isEmpty();
case NativePackage.NATIVE_INTERFACE__DESCRIPTOR:
return DESCRIPTOR_EDEFAULT == null ? descriptor != null : !DESCRIPTOR_EDEFAULT.equals(descriptor);
case NativePackage.NATIVE_INTERFACE__ANY_ATTRIBUTE:
return anyAttribute != null && !anyAttribute.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (any: ");
result.append(any);
result.append(", descriptor: ");
result.append(descriptor);
result.append(", anyAttribute: ");
result.append(anyAttribute);
result.append(')');
return result.toString();
}
} //NativeInterfaceImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy