package automaticexperiment.impl; | |
/******************************************************************************* | |
* Copyright (c) 2009 IBM Corporation and others. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* IBM Corporation - initial API and implementation | |
*******************************************************************************/ | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.util.URI; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.EStructuralFeature; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.impl.EObjectImpl; | |
import automaticexperiment.AutomaticexperimentPackage; | |
import automaticexperiment.ModifiableParameter; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Modifiable Parameter</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getInitialValue <em>Initial Value</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getFeature <em>Feature</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getStep <em>Step</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getFeatureName <em>Feature Name</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getLowerBound <em>Lower Bound</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getUpperBound <em>Upper Bound</em>}</li> | |
* <li>{@link automaticexperiment.impl.ModifiableParameterImpl#getTargetURI <em>Target URI</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class ModifiableParameterImpl extends EObjectImpl implements ModifiableParameter { | |
/** | |
* The default value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getInitialValue() | |
* @generated | |
* @ordered | |
*/ | |
protected static final double INITIAL_VALUE_EDEFAULT = 0.0; | |
/** | |
* The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getInitialValue() | |
* @generated | |
* @ordered | |
*/ | |
protected double initialValue = INITIAL_VALUE_EDEFAULT; | |
/** | |
* The cached value of the '{@link #getFeature() <em>Feature</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFeature() | |
* @generated | |
* @ordered | |
*/ | |
protected EStructuralFeature feature; | |
/** | |
* The default value of the '{@link #getStep() <em>Step</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getStep() | |
* @generated | |
* @ordered | |
*/ | |
protected static final double STEP_EDEFAULT = 0.0; | |
/** | |
* The cached value of the '{@link #getStep() <em>Step</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getStep() | |
* @generated | |
* @ordered | |
*/ | |
protected double step = STEP_EDEFAULT; | |
/** | |
* The default value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFeatureName() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String FEATURE_NAME_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFeatureName() | |
* @generated | |
* @ordered | |
*/ | |
protected String featureName = FEATURE_NAME_EDEFAULT; | |
/** | |
* The default value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getLowerBound() | |
* @generated | |
* @ordered | |
*/ | |
protected static final double LOWER_BOUND_EDEFAULT = -1.0; | |
/** | |
* The cached value of the '{@link #getLowerBound() <em>Lower Bound</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getLowerBound() | |
* @generated | |
* @ordered | |
*/ | |
protected double lowerBound = LOWER_BOUND_EDEFAULT; | |
/** | |
* The default value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getUpperBound() | |
* @generated | |
* @ordered | |
*/ | |
protected static final double UPPER_BOUND_EDEFAULT = -1.0; | |
/** | |
* The cached value of the '{@link #getUpperBound() <em>Upper Bound</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getUpperBound() | |
* @generated | |
* @ordered | |
*/ | |
protected double upperBound = UPPER_BOUND_EDEFAULT; | |
/** | |
* The default value of the '{@link #getTargetURI() <em>Target URI</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTargetURI() | |
* @generated | |
* @ordered | |
*/ | |
protected static final URI TARGET_URI_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getTargetURI() <em>Target URI</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTargetURI() | |
* @generated | |
* @ordered | |
*/ | |
protected URI targetURI = TARGET_URI_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ModifiableParameterImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return AutomaticexperimentPackage.Literals.MODIFIABLE_PARAMETER; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public double getInitialValue() { | |
return initialValue; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setInitialValue(double newInitialValue) { | |
double oldInitialValue = initialValue; | |
initialValue = newInitialValue; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__INITIAL_VALUE, oldInitialValue, initialValue)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EStructuralFeature getFeature() { | |
if (feature != null && feature.eIsProxy()) { | |
InternalEObject oldFeature = (InternalEObject)feature; | |
feature = (EStructuralFeature)eResolveProxy(oldFeature); | |
if (feature != oldFeature) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE, oldFeature, feature)); | |
} | |
} | |
return feature; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EStructuralFeature basicGetFeature() { | |
return feature; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setFeature(EStructuralFeature newFeature) { | |
EStructuralFeature oldFeature = feature; | |
feature = newFeature; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE, oldFeature, feature)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public double getStep() { | |
return step; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setStep(double newStep) { | |
double oldStep = step; | |
step = newStep; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__STEP, oldStep, step)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getFeatureName() { | |
return featureName; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setFeatureName(String newFeatureName) { | |
String oldFeatureName = featureName; | |
featureName = newFeatureName; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE_NAME, oldFeatureName, featureName)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public double getLowerBound() { | |
return lowerBound; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setLowerBound(double newLowerBound) { | |
double oldLowerBound = lowerBound; | |
lowerBound = newLowerBound; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__LOWER_BOUND, oldLowerBound, lowerBound)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public double getUpperBound() { | |
return upperBound; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setUpperBound(double newUpperBound) { | |
double oldUpperBound = upperBound; | |
upperBound = newUpperBound; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__UPPER_BOUND, oldUpperBound, upperBound)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public URI getTargetURI() { | |
return targetURI; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setTargetURI(URI newTargetURI) { | |
URI oldTargetURI = targetURI; | |
targetURI = newTargetURI; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, AutomaticexperimentPackage.MODIFIABLE_PARAMETER__TARGET_URI, oldTargetURI, targetURI)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__INITIAL_VALUE: | |
return getInitialValue(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE: | |
if (resolve) return getFeature(); | |
return basicGetFeature(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__STEP: | |
return getStep(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE_NAME: | |
return getFeatureName(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__LOWER_BOUND: | |
return getLowerBound(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__UPPER_BOUND: | |
return getUpperBound(); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__TARGET_URI: | |
return getTargetURI(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__INITIAL_VALUE: | |
setInitialValue((Double)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE: | |
setFeature((EStructuralFeature)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__STEP: | |
setStep((Double)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE_NAME: | |
setFeatureName((String)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__LOWER_BOUND: | |
setLowerBound((Double)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__UPPER_BOUND: | |
setUpperBound((Double)newValue); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__TARGET_URI: | |
setTargetURI((URI)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__INITIAL_VALUE: | |
setInitialValue(INITIAL_VALUE_EDEFAULT); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE: | |
setFeature((EStructuralFeature)null); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__STEP: | |
setStep(STEP_EDEFAULT); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE_NAME: | |
setFeatureName(FEATURE_NAME_EDEFAULT); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__LOWER_BOUND: | |
setLowerBound(LOWER_BOUND_EDEFAULT); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__UPPER_BOUND: | |
setUpperBound(UPPER_BOUND_EDEFAULT); | |
return; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__TARGET_URI: | |
setTargetURI(TARGET_URI_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__INITIAL_VALUE: | |
return initialValue != INITIAL_VALUE_EDEFAULT; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE: | |
return feature != null; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__STEP: | |
return step != STEP_EDEFAULT; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__FEATURE_NAME: | |
return FEATURE_NAME_EDEFAULT == null ? featureName != null : !FEATURE_NAME_EDEFAULT.equals(featureName); | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__LOWER_BOUND: | |
return lowerBound != LOWER_BOUND_EDEFAULT; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__UPPER_BOUND: | |
return upperBound != UPPER_BOUND_EDEFAULT; | |
case AutomaticexperimentPackage.MODIFIABLE_PARAMETER__TARGET_URI: | |
return TARGET_URI_EDEFAULT == null ? targetURI != null : !TARGET_URI_EDEFAULT.equals(targetURI); | |
} | |
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(" (initialValue: "); | |
result.append(initialValue); | |
result.append(", step: "); | |
result.append(step); | |
result.append(", featureName: "); | |
result.append(featureName); | |
result.append(", lowerBound: "); | |
result.append(lowerBound); | |
result.append(", upperBound: "); | |
result.append(upperBound); | |
result.append(", targetURI: "); | |
result.append(targetURI); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //ModifiableParameterImpl |