blob: 86c90db70a124b4a80a4b152416c66191d65a58d [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.core.databinding.tests.emf.model.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.ecview.core.databinding.tests.emf.model.TAddress;
import org.eclipse.osbp.ecview.core.databinding.tests.emf.model.TPerson;
import org.eclipse.osbp.ecview.core.databinding.tests.emf.model.TestmodelPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>TPerson</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.ecview.core.databinding.tests.emf.model.impl.TPersonImpl#getAddress <em>Address</em>}</li>
* </ul>
*
*
* @generated
*/
public class TPersonImpl extends MinimalEObjectImpl.Container implements TPerson {
/**
* The cached value of the '{@link #getAddress() <em>Address</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAddress()
* @generated
* @ordered
*/
protected TAddress address;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TPersonImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TestmodelPackage.Literals.TPERSON;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TAddress getAddress() {
if (address != null && address.eIsProxy()) {
InternalEObject oldAddress = (InternalEObject)address;
address = (TAddress)eResolveProxy(oldAddress);
if (address != oldAddress) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestmodelPackage.TPERSON__ADDRESS, oldAddress, address));
}
}
return address;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TAddress basicGetAddress() {
return address;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAddress(TAddress newAddress) {
TAddress oldAddress = address;
address = newAddress;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TestmodelPackage.TPERSON__ADDRESS, oldAddress, address));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TestmodelPackage.TPERSON__ADDRESS:
if (resolve) return getAddress();
return basicGetAddress();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TestmodelPackage.TPERSON__ADDRESS:
setAddress((TAddress)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TestmodelPackage.TPERSON__ADDRESS:
setAddress((TAddress)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TestmodelPackage.TPERSON__ADDRESS:
return address != null;
}
return super.eIsSet(featureID);
}
} //TPersonImpl