/** */ package org.archstudio.xadl3.hints_3_0.impl; import java.util.Collection; import org.archstudio.xadl3.hints_3_0.Hints_3_0Package; import org.archstudio.xadl3.hints_3_0.Value; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; 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 org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Value</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.ValueImpl#getValue <em>Value</em>}</li> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.ValueImpl#getData <em>Data</em>}</li> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.ValueImpl#getType <em>Type</em>}</li> * </ul> * * @generated */ public class ValueImpl extends MinimalEObjectImpl.Container implements Value { /** * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference list. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #getValue() * @generated * @ordered */ protected EList<Value> value; /** * The default value of the '{@link #getData() <em>Data</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getData() * @generated * @ordered */ protected static final String DATA_EDEFAULT = null; /** * The cached value of the '{@link #getData() <em>Data</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getData() * @generated * @ordered */ protected String data = DATA_EDEFAULT; /** * The default value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getType() * @generated * @ordered */ protected static final String TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getType() * @generated * @ordered */ protected String type = TYPE_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected ValueImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return Hints_3_0Package.Literals.VALUE; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EList<Value> getValue() { if (value == null) { value = new EObjectContainmentEList<Value>(Value.class, this, Hints_3_0Package.VALUE__VALUE); } return value; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getData() { return data; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setData(String newData) { String oldData = data; data = newData; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Hints_3_0Package.VALUE__DATA, oldData, data)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getType() { return type; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setType(String newType) { String oldType = type; type = newType; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Hints_3_0Package.VALUE__TYPE, oldType, type)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Hints_3_0Package.VALUE__VALUE: return ((InternalEList<?>) getValue()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Hints_3_0Package.VALUE__VALUE: return getValue(); case Hints_3_0Package.VALUE__DATA: return getData(); case Hints_3_0Package.VALUE__TYPE: return getType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Hints_3_0Package.VALUE__VALUE: getValue().clear(); getValue().addAll((Collection<? extends Value>) newValue); return; case Hints_3_0Package.VALUE__DATA: setData((String) newValue); return; case Hints_3_0Package.VALUE__TYPE: setType((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Hints_3_0Package.VALUE__VALUE: getValue().clear(); return; case Hints_3_0Package.VALUE__DATA: setData(DATA_EDEFAULT); return; case Hints_3_0Package.VALUE__TYPE: setType(TYPE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Hints_3_0Package.VALUE__VALUE: return value != null && !value.isEmpty(); case Hints_3_0Package.VALUE__DATA: return DATA_EDEFAULT == null ? data != null : !DATA_EDEFAULT.equals(data); case Hints_3_0Package.VALUE__TYPE: return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); } 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(" (data: "); result.append(data); result.append(", type: "); result.append(type); result.append(')'); return result.toString(); } } // ValueImpl