/**
*/
package crossingScenario.impl;
import crossingScenario.CrossingScenarioPackage;
import crossingScenario.Distance;
import crossingScenario.SeparationDistance;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'Separation Distance'.
*
*
* The following features are implemented:
*
*
* - {@link crossingScenario.impl.SeparationDistanceImpl#getDistance Distance}
*
*
* @generated
*/
public class SeparationDistanceImpl extends SpatialRelationImpl implements SeparationDistance {
/**
* The default value of the '{@link #getDistance() Distance}' attribute.
*
*
* @see #getDistance()
* @generated
* @ordered
*/
protected static final Distance DISTANCE_EDEFAULT = Distance.DNEAR;
/**
* The cached value of the '{@link #getDistance() Distance}' attribute.
*
*
* @see #getDistance()
* @generated
* @ordered
*/
protected Distance distance = DISTANCE_EDEFAULT;
/**
*
*
* @generated
*/
protected SeparationDistanceImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CrossingScenarioPackage.Literals.SEPARATION_DISTANCE;
}
/**
*
*
* @generated
*/
@Override
public Distance getDistance() {
return distance;
}
/**
*
*
* @generated
*/
@Override
public void setDistance(Distance newDistance) {
Distance oldDistance = distance;
distance = newDistance == null ? DISTANCE_EDEFAULT : newDistance;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CrossingScenarioPackage.SEPARATION_DISTANCE__DISTANCE, oldDistance, distance));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CrossingScenarioPackage.SEPARATION_DISTANCE__DISTANCE:
return getDistance();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CrossingScenarioPackage.SEPARATION_DISTANCE__DISTANCE:
setDistance((Distance)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CrossingScenarioPackage.SEPARATION_DISTANCE__DISTANCE:
setDistance(DISTANCE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CrossingScenarioPackage.SEPARATION_DISTANCE__DISTANCE:
return distance != DISTANCE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (distance: ");
result.append(distance);
result.append(')');
return result.toString();
}
} //SeparationDistanceImpl