All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openxma.dsl.dom.model.impl.PropertyValueImpl Maven / Gradle / Ivy

/**
 * 
 * 
 *
 * $Id$
 */
package org.openxma.dsl.dom.model.impl;

import java.util.Collection;

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.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Expression;
import org.openxma.dsl.dom.model.PropertyValue;

/**
 * 
 * An implementation of the model object 'Property Value'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.openxma.dsl.dom.model.impl.PropertyValueImpl#getName Name}
  • *
  • {@link org.openxma.dsl.dom.model.impl.PropertyValueImpl#getSegments Segments}
  • *
  • {@link org.openxma.dsl.dom.model.impl.PropertyValueImpl#getIndex Index}
  • *
  • {@link org.openxma.dsl.dom.model.impl.PropertyValueImpl#isClassProperty Class Property}
  • *
*

* * @generated */ public class PropertyValueImpl extends ExpressionImpl implements PropertyValue { /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getSegments() Segments}' attribute list. * * * @see #getSegments() * @generated * @ordered */ protected EList segments; /** * The cached value of the '{@link #getIndex() Index}' containment reference list. * * * @see #getIndex() * @generated * @ordered */ protected EList index; /** * The default value of the '{@link #isClassProperty() Class Property}' attribute. * * * @see #isClassProperty() * @generated * @ordered */ protected static final boolean CLASS_PROPERTY_EDEFAULT = false; /** * The cached value of the '{@link #isClassProperty() Class Property}' attribute. * * * @see #isClassProperty() * @generated * @ordered */ protected boolean classProperty = CLASS_PROPERTY_EDEFAULT; /** * * * @generated */ protected PropertyValueImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return DomPackage.Literals.PROPERTY_VALUE; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.PROPERTY_VALUE__NAME, oldName, name)); } /** * * * @generated */ public EList getSegments() { if (segments == null) { segments = new EDataTypeEList(String.class, this, DomPackage.PROPERTY_VALUE__SEGMENTS); } return segments; } /** * * * @generated */ public EList getIndex() { if (index == null) { index = new EObjectContainmentEList(Expression.class, this, DomPackage.PROPERTY_VALUE__INDEX); } return index; } /** * * * @generated */ public boolean isClassProperty() { return classProperty; } /** * * * @generated */ public void setClassProperty(boolean newClassProperty) { boolean oldClassProperty = classProperty; classProperty = newClassProperty; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.PROPERTY_VALUE__CLASS_PROPERTY, oldClassProperty, classProperty)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DomPackage.PROPERTY_VALUE__INDEX: return ((InternalEList)getIndex()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DomPackage.PROPERTY_VALUE__NAME: return getName(); case DomPackage.PROPERTY_VALUE__SEGMENTS: return getSegments(); case DomPackage.PROPERTY_VALUE__INDEX: return getIndex(); case DomPackage.PROPERTY_VALUE__CLASS_PROPERTY: return isClassProperty(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DomPackage.PROPERTY_VALUE__NAME: setName((String)newValue); return; case DomPackage.PROPERTY_VALUE__SEGMENTS: getSegments().clear(); getSegments().addAll((Collection)newValue); return; case DomPackage.PROPERTY_VALUE__INDEX: getIndex().clear(); getIndex().addAll((Collection)newValue); return; case DomPackage.PROPERTY_VALUE__CLASS_PROPERTY: setClassProperty((Boolean)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DomPackage.PROPERTY_VALUE__NAME: setName(NAME_EDEFAULT); return; case DomPackage.PROPERTY_VALUE__SEGMENTS: getSegments().clear(); return; case DomPackage.PROPERTY_VALUE__INDEX: getIndex().clear(); return; case DomPackage.PROPERTY_VALUE__CLASS_PROPERTY: setClassProperty(CLASS_PROPERTY_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DomPackage.PROPERTY_VALUE__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case DomPackage.PROPERTY_VALUE__SEGMENTS: return segments != null && !segments.isEmpty(); case DomPackage.PROPERTY_VALUE__INDEX: return index != null && !index.isEmpty(); case DomPackage.PROPERTY_VALUE__CLASS_PROPERTY: return classProperty != CLASS_PROPERTY_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", segments: "); result.append(segments); result.append(", classProperty: "); result.append(classProperty); result.append(')'); return result.toString(); } } //PropertyValueImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy