/**
*/
package TaxationWithRoot.impl;
import TaxationWithRoot.Dependent;
import TaxationWithRoot.FromAgent;
import TaxationWithRoot.FromLaw;
import TaxationWithRoot.Income;
import TaxationWithRoot.Tax_Payer;
import TaxationWithRoot.TaxationWithRootPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Tax Payer'.
*
*
* The following features are implemented:
*
*
* - {@link TaxationWithRoot.impl.Tax_PayerImpl#getDependents Dependents}
* - {@link TaxationWithRoot.impl.Tax_PayerImpl#getFrom_agent From agent}
* - {@link TaxationWithRoot.impl.Tax_PayerImpl#getIncomes Incomes}
* - {@link TaxationWithRoot.impl.Tax_PayerImpl#getFrom_law From law}
*
*
* @generated
*/
public abstract class Tax_PayerImpl extends Physical_PersonImpl implements Tax_Payer {
/**
* The cached value of the '{@link #getDependents() Dependents}' containment reference list.
*
*
* @see #getDependents()
* @generated
* @ordered
*/
protected EList dependents;
/**
* The cached value of the '{@link #getFrom_agent() From agent}' containment reference.
*
*
* @see #getFrom_agent()
* @generated
* @ordered
*/
protected FromAgent from_agent;
/**
* The cached value of the '{@link #getIncomes() Incomes}' containment reference list.
*
*
* @see #getIncomes()
* @generated
* @ordered
*/
protected EList incomes;
/**
* The cached value of the '{@link #getFrom_law() From law}' containment reference.
*
*
* @see #getFrom_law()
* @generated
* @ordered
*/
protected FromLaw from_law;
/**
*
*
* @generated
*/
protected Tax_PayerImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return TaxationWithRootPackage.Literals.TAX_PAYER;
}
/**
*
*
* @generated
*/
@Override
public EList getDependents() {
if (dependents == null) {
dependents = new EObjectContainmentWithInverseEList(Dependent.class, this, TaxationWithRootPackage.TAX_PAYER__DEPENDENTS, TaxationWithRootPackage.DEPENDENT__RESPONSIBLE_PERSON);
}
return dependents;
}
/**
*
*
* @generated
*/
@Override
public FromAgent getFrom_agent() {
return from_agent;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetFrom_agent(FromAgent newFrom_agent, NotificationChain msgs) {
FromAgent oldFrom_agent = from_agent;
from_agent = newFrom_agent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.TAX_PAYER__FROM_AGENT, oldFrom_agent, newFrom_agent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setFrom_agent(FromAgent newFrom_agent) {
if (newFrom_agent != from_agent) {
NotificationChain msgs = null;
if (from_agent != null)
msgs = ((InternalEObject)from_agent).eInverseRemove(this, TaxationWithRootPackage.FROM_AGENT__TAX_PAYER, FromAgent.class, msgs);
if (newFrom_agent != null)
msgs = ((InternalEObject)newFrom_agent).eInverseAdd(this, TaxationWithRootPackage.FROM_AGENT__TAX_PAYER, FromAgent.class, msgs);
msgs = basicSetFrom_agent(newFrom_agent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.TAX_PAYER__FROM_AGENT, newFrom_agent, newFrom_agent));
}
/**
*
*
* @generated
*/
@Override
public EList getIncomes() {
if (incomes == null) {
incomes = new EObjectContainmentWithInverseEList(Income.class, this, TaxationWithRootPackage.TAX_PAYER__INCOMES, TaxationWithRootPackage.INCOME__TAX_PAYER);
}
return incomes;
}
/**
*
*
* @generated
*/
@Override
public FromLaw getFrom_law() {
return from_law;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetFrom_law(FromLaw newFrom_law, NotificationChain msgs) {
FromLaw oldFrom_law = from_law;
from_law = newFrom_law;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.TAX_PAYER__FROM_LAW, oldFrom_law, newFrom_law);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setFrom_law(FromLaw newFrom_law) {
if (newFrom_law != from_law) {
NotificationChain msgs = null;
if (from_law != null)
msgs = ((InternalEObject)from_law).eInverseRemove(this, TaxationWithRootPackage.FROM_LAW__TAX_PAYER, FromLaw.class, msgs);
if (newFrom_law != null)
msgs = ((InternalEObject)newFrom_law).eInverseAdd(this, TaxationWithRootPackage.FROM_LAW__TAX_PAYER, FromLaw.class, msgs);
msgs = basicSetFrom_law(newFrom_law, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.TAX_PAYER__FROM_LAW, newFrom_law, newFrom_law));
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
return ((InternalEList)(InternalEList>)getDependents()).basicAdd(otherEnd, msgs);
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
if (from_agent != null)
msgs = ((InternalEObject)from_agent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationWithRootPackage.TAX_PAYER__FROM_AGENT, null, msgs);
return basicSetFrom_agent((FromAgent)otherEnd, msgs);
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
return ((InternalEList)(InternalEList>)getIncomes()).basicAdd(otherEnd, msgs);
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
if (from_law != null)
msgs = ((InternalEObject)from_law).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationWithRootPackage.TAX_PAYER__FROM_LAW, null, msgs);
return basicSetFrom_law((FromLaw)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
return ((InternalEList>)getDependents()).basicRemove(otherEnd, msgs);
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
return basicSetFrom_agent(null, msgs);
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
return ((InternalEList>)getIncomes()).basicRemove(otherEnd, msgs);
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
return basicSetFrom_law(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
return getDependents();
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
return getFrom_agent();
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
return getIncomes();
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
return getFrom_law();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
getDependents().clear();
getDependents().addAll((Collection extends Dependent>)newValue);
return;
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
setFrom_agent((FromAgent)newValue);
return;
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
getIncomes().clear();
getIncomes().addAll((Collection extends Income>)newValue);
return;
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
setFrom_law((FromLaw)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
getDependents().clear();
return;
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
setFrom_agent((FromAgent)null);
return;
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
getIncomes().clear();
return;
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
setFrom_law((FromLaw)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TaxationWithRootPackage.TAX_PAYER__DEPENDENTS:
return dependents != null && !dependents.isEmpty();
case TaxationWithRootPackage.TAX_PAYER__FROM_AGENT:
return from_agent != null;
case TaxationWithRootPackage.TAX_PAYER__INCOMES:
return incomes != null && !incomes.isEmpty();
case TaxationWithRootPackage.TAX_PAYER__FROM_LAW:
return from_law != null;
}
return super.eIsSet(featureID);
}
} //Tax_PayerImpl