| package org.eclipse.stem.definitions.edges.impl; |
| |
| /******************************************************************************* |
| * Copyright (c) 2011 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.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.stem.core.graph.impl.EdgeImpl; |
| import org.eclipse.stem.definitions.edges.EdgesPackage; |
| import org.eclipse.stem.definitions.edges.PopulationEdge; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Population Edge</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.stem.definitions.edges.impl.PopulationEdgeImpl#getPopulationIdentifier <em>Population Identifier</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PopulationEdgeImpl extends EdgeImpl implements PopulationEdge { |
| /** |
| * The default value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPopulationIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected static final String POPULATION_IDENTIFIER_EDEFAULT = "human"; //$NON-NLS-1$ |
| |
| /** |
| * The cached value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPopulationIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected String populationIdentifier = POPULATION_IDENTIFIER_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PopulationEdgeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EdgesPackage.Literals.POPULATION_EDGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getPopulationIdentifier() { |
| return populationIdentifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setPopulationIdentifier(String newPopulationIdentifier) { |
| String oldPopulationIdentifier = populationIdentifier; |
| populationIdentifier = newPopulationIdentifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EdgesPackage.POPULATION_EDGE__POPULATION_IDENTIFIER, oldPopulationIdentifier, populationIdentifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case EdgesPackage.POPULATION_EDGE__POPULATION_IDENTIFIER: |
| return getPopulationIdentifier(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case EdgesPackage.POPULATION_EDGE__POPULATION_IDENTIFIER: |
| setPopulationIdentifier((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EdgesPackage.POPULATION_EDGE__POPULATION_IDENTIFIER: |
| setPopulationIdentifier(POPULATION_IDENTIFIER_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EdgesPackage.POPULATION_EDGE__POPULATION_IDENTIFIER: |
| return POPULATION_IDENTIFIER_EDEFAULT == null ? populationIdentifier != null : !POPULATION_IDENTIFIER_EDEFAULT.equals(populationIdentifier); |
| } |
| 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(" (populationIdentifier: "); //$NON-NLS-1$ |
| result.append(populationIdentifier); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PopulationEdgeImpl |