/**
*/
package TaxationWithRoot.impl;
import TaxationWithRoot.Dependent;
import TaxationWithRoot.Household;
import TaxationWithRoot.Legal_Union_Record;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Household'.
*
*
* The following features are implemented:
*
*
* - {@link TaxationWithRoot.impl.HouseholdImpl#getParents Parents}
* - {@link TaxationWithRoot.impl.HouseholdImpl#getId1 Id1}
* - {@link TaxationWithRoot.impl.HouseholdImpl#getChildren Children}
*
*
* @generated
*/
public class HouseholdImpl extends MinimalEObjectImpl.Container implements Household {
/**
* The cached value of the '{@link #getParents() Parents}' containment reference.
*
*
* @see #getParents()
* @generated
* @ordered
*/
protected Legal_Union_Record parents;
/**
* The default value of the '{@link #getId1() Id1}' attribute.
*
*
* @see #getId1()
* @generated
* @ordered
*/
protected static final String ID1_EDEFAULT = null;
/**
* The cached value of the '{@link #getId1() Id1}' attribute.
*
*
* @see #getId1()
* @generated
* @ordered
*/
protected String id1 = ID1_EDEFAULT;
/**
* The cached value of the '{@link #getChildren() Children}' containment reference list.
*
*
* @see #getChildren()
* @generated
* @ordered
*/
protected EList children;
/**
*
*
* @generated
*/
protected HouseholdImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return TaxationWithRootPackage.Literals.HOUSEHOLD;
}
/**
*
*
* @generated
*/
@Override
public Legal_Union_Record getParents() {
return parents;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetParents(Legal_Union_Record newParents, NotificationChain msgs) {
Legal_Union_Record oldParents = parents;
parents = newParents;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.HOUSEHOLD__PARENTS, oldParents, newParents);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setParents(Legal_Union_Record newParents) {
if (newParents != parents) {
NotificationChain msgs = null;
if (parents != null)
msgs = ((InternalEObject)parents).eInverseRemove(this, TaxationWithRootPackage.LEGAL_UNION_RECORD__HOUSEHOLD, Legal_Union_Record.class, msgs);
if (newParents != null)
msgs = ((InternalEObject)newParents).eInverseAdd(this, TaxationWithRootPackage.LEGAL_UNION_RECORD__HOUSEHOLD, Legal_Union_Record.class, msgs);
msgs = basicSetParents(newParents, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.HOUSEHOLD__PARENTS, newParents, newParents));
}
/**
*
*
* @generated
*/
@Override
public String getId1() {
return id1;
}
/**
*
*
* @generated
*/
@Override
public void setId1(String newId1) {
String oldId1 = id1;
id1 = newId1;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaxationWithRootPackage.HOUSEHOLD__ID1, oldId1, id1));
}
/**
*
*
* @generated
*/
@Override
public EList getChildren() {
if (children == null) {
children = new EObjectContainmentWithInverseEList(Dependent.class, this, TaxationWithRootPackage.HOUSEHOLD__CHILDREN, TaxationWithRootPackage.DEPENDENT__HOUSEHOLD);
}
return children;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
if (parents != null)
msgs = ((InternalEObject)parents).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TaxationWithRootPackage.HOUSEHOLD__PARENTS, null, msgs);
return basicSetParents((Legal_Union_Record)otherEnd, msgs);
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
return ((InternalEList)(InternalEList>)getChildren()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
return basicSetParents(null, msgs);
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
return ((InternalEList>)getChildren()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
return getParents();
case TaxationWithRootPackage.HOUSEHOLD__ID1:
return getId1();
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
return getChildren();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
setParents((Legal_Union_Record)newValue);
return;
case TaxationWithRootPackage.HOUSEHOLD__ID1:
setId1((String)newValue);
return;
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
getChildren().clear();
getChildren().addAll((Collection extends Dependent>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
setParents((Legal_Union_Record)null);
return;
case TaxationWithRootPackage.HOUSEHOLD__ID1:
setId1(ID1_EDEFAULT);
return;
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
getChildren().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TaxationWithRootPackage.HOUSEHOLD__PARENTS:
return parents != null;
case TaxationWithRootPackage.HOUSEHOLD__ID1:
return ID1_EDEFAULT == null ? id1 != null : !ID1_EDEFAULT.equals(id1);
case TaxationWithRootPackage.HOUSEHOLD__CHILDREN:
return children != null && !children.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (id1: ");
result.append(id1);
result.append(')');
return result.toString();
}
} //HouseholdImpl