| /** |
| * Copyright (c) 2016 Willink Transformations, Univesity of York 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: |
| * Adolfo Sanchez-Barbudo Herrera - initial API and implementation |
| */ |
| package cs2as.companies.impl; |
| |
| import cs2as.companies.CompaniesPackage; |
| import cs2as.companies.employee; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>employee</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link cs2as.companies.impl.employeeImpl#getName <em>Name</em>}</li> |
| * <li>{@link cs2as.companies.impl.employeeImpl#getAddress <em>Address</em>}</li> |
| * <li>{@link cs2as.companies.impl.employeeImpl#getSalary <em>Salary</em>}</li> |
| * <li>{@link cs2as.companies.impl.employeeImpl#getMentor <em>Mentor</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class employeeImpl extends CSTraceImpl implements employee { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getAddress() <em>Address</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAddress() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ADDRESS_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAddress() <em>Address</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAddress() |
| * @generated |
| * @ordered |
| */ |
| protected String address = ADDRESS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getSalary() <em>Salary</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSalary() |
| * @generated |
| * @ordered |
| */ |
| protected static final double SALARY_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getSalary() <em>Salary</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSalary() |
| * @generated |
| * @ordered |
| */ |
| protected double salary = SALARY_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMentor() <em>Mentor</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMentor() |
| * @generated |
| * @ordered |
| */ |
| protected static final String MENTOR_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getMentor() <em>Mentor</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMentor() |
| * @generated |
| * @ordered |
| */ |
| protected String mentor = MENTOR_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected employeeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CompaniesPackage.Literals.EMPLOYEE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CompaniesPackage.EMPLOYEE__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getAddress() { |
| return address; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAddress(String newAddress) { |
| String oldAddress = address; |
| address = newAddress; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CompaniesPackage.EMPLOYEE__ADDRESS, oldAddress, address)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getSalary() { |
| return salary; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSalary(double newSalary) { |
| double oldSalary = salary; |
| salary = newSalary; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CompaniesPackage.EMPLOYEE__SALARY, oldSalary, salary)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getMentor() { |
| return mentor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMentor(String newMentor) { |
| String oldMentor = mentor; |
| mentor = newMentor; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CompaniesPackage.EMPLOYEE__MENTOR, oldMentor, mentor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CompaniesPackage.EMPLOYEE__NAME: |
| return getName(); |
| case CompaniesPackage.EMPLOYEE__ADDRESS: |
| return getAddress(); |
| case CompaniesPackage.EMPLOYEE__SALARY: |
| return getSalary(); |
| case CompaniesPackage.EMPLOYEE__MENTOR: |
| return getMentor(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CompaniesPackage.EMPLOYEE__NAME: |
| setName((String)newValue); |
| return; |
| case CompaniesPackage.EMPLOYEE__ADDRESS: |
| setAddress((String)newValue); |
| return; |
| case CompaniesPackage.EMPLOYEE__SALARY: |
| setSalary((Double)newValue); |
| return; |
| case CompaniesPackage.EMPLOYEE__MENTOR: |
| setMentor((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CompaniesPackage.EMPLOYEE__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case CompaniesPackage.EMPLOYEE__ADDRESS: |
| setAddress(ADDRESS_EDEFAULT); |
| return; |
| case CompaniesPackage.EMPLOYEE__SALARY: |
| setSalary(SALARY_EDEFAULT); |
| return; |
| case CompaniesPackage.EMPLOYEE__MENTOR: |
| setMentor(MENTOR_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CompaniesPackage.EMPLOYEE__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case CompaniesPackage.EMPLOYEE__ADDRESS: |
| return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address); |
| case CompaniesPackage.EMPLOYEE__SALARY: |
| return salary != SALARY_EDEFAULT; |
| case CompaniesPackage.EMPLOYEE__MENTOR: |
| return MENTOR_EDEFAULT == null ? mentor != null : !MENTOR_EDEFAULT.equals(mentor); |
| } |
| 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(" (name: "); |
| result.append(name); |
| result.append(", address: "); |
| result.append(address); |
| result.append(", salary: "); |
| result.append(salary); |
| result.append(", mentor: "); |
| result.append(mentor); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| |
| } //employeeImpl |