blob: 383c8d05fc31aafb053aea5aea7bf3799b79ff98 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package lobj.impl;
import lobj.Address;
import lobj.Author;
import lobj.LobjPackage;
import lobj.Person;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.EObjectImpl;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Author</b></em>'. <!--
* end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link lobj.impl.AuthorImpl#getCredittype <em>Credittype</em>}</li>
* <li>{@link lobj.impl.AuthorImpl#getPerson <em>Person</em>}</li>
* <li>{@link lobj.impl.AuthorImpl#getAddress <em>Address</em>}</li>
* <li>{@link lobj.impl.AuthorImpl#getEmail <em>Email</em>}</li>
* <li>{@link lobj.impl.AuthorImpl#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AuthorImpl extends EObjectImpl implements Author {
/**
* The default value of the '{@link #getCredittype() <em>Credittype</em>}' attribute. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getCredittype()
* @generated
* @ordered
*/
protected static final String CREDITTYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getCredittype() <em>Credittype</em>}' attribute. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getCredittype()
* @generated
* @ordered
*/
protected String credittype = CREDITTYPE_EDEFAULT;
/**
* The cached value of the '{@link #getPerson() <em>Person</em>}' containment reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getPerson()
* @generated
* @ordered
*/
protected Person person;
/**
* The cached value of the '{@link #getAddress() <em>Address</em>}' containment reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getAddress()
* @generated
* @ordered
*/
protected Address address;
/**
* The default value of the '{@link #getEmail() <em>Email</em>}' attribute. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
* @see #getEmail()
* @generated
* @ordered
*/
protected static final String EMAIL_EDEFAULT = null;
/**
* The cached value of the '{@link #getEmail() <em>Email</em>}' attribute. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getEmail()
* @generated
* @ordered
*/
protected String email = EMAIL_EDEFAULT;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected AuthorImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected EClass eStaticClass() {
return LobjPackage.Literals.AUTHOR;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getCredittype() {
return credittype;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setCredittype(String newCredittype) {
String oldCredittype = credittype;
credittype = newCredittype;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LobjPackage.AUTHOR__CREDITTYPE,
oldCredittype, credittype));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Person getPerson() {
return person;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain basicSetPerson(Person newPerson, NotificationChain msgs) {
Person oldPerson = person;
person = newPerson;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
LobjPackage.AUTHOR__PERSON, oldPerson, newPerson);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setPerson(Person newPerson) {
if (newPerson != person) {
NotificationChain msgs = null;
if (person != null)
msgs = ((InternalEObject) person).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- LobjPackage.AUTHOR__PERSON, null, msgs);
if (newPerson != null)
msgs = ((InternalEObject) newPerson).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- LobjPackage.AUTHOR__PERSON, null, msgs);
msgs = basicSetPerson(newPerson, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LobjPackage.AUTHOR__PERSON, newPerson,
newPerson));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Address getAddress() {
return address;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain basicSetAddress(Address newAddress, NotificationChain msgs) {
Address oldAddress = address;
address = newAddress;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
LobjPackage.AUTHOR__ADDRESS, oldAddress, newAddress);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setAddress(Address newAddress) {
if (newAddress != address) {
NotificationChain msgs = null;
if (address != null)
msgs = ((InternalEObject) address).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- LobjPackage.AUTHOR__ADDRESS, null, msgs);
if (newAddress != null)
msgs = ((InternalEObject) newAddress).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- LobjPackage.AUTHOR__ADDRESS, null, msgs);
msgs = basicSetAddress(newAddress, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LobjPackage.AUTHOR__ADDRESS,
newAddress, newAddress));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getEmail() {
return email;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setEmail(String newEmail) {
String oldEmail = email;
email = newEmail;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LobjPackage.AUTHOR__EMAIL, oldEmail,
email));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LobjPackage.AUTHOR__ID, oldId, id));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID,
NotificationChain msgs) {
switch (featureID) {
case LobjPackage.AUTHOR__PERSON:
return basicSetPerson(null, msgs);
case LobjPackage.AUTHOR__ADDRESS:
return basicSetAddress(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case LobjPackage.AUTHOR__CREDITTYPE:
return getCredittype();
case LobjPackage.AUTHOR__PERSON:
return getPerson();
case LobjPackage.AUTHOR__ADDRESS:
return getAddress();
case LobjPackage.AUTHOR__EMAIL:
return getEmail();
case LobjPackage.AUTHOR__ID:
return getId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case LobjPackage.AUTHOR__CREDITTYPE:
setCredittype((String) newValue);
return;
case LobjPackage.AUTHOR__PERSON:
setPerson((Person) newValue);
return;
case LobjPackage.AUTHOR__ADDRESS:
setAddress((Address) newValue);
return;
case LobjPackage.AUTHOR__EMAIL:
setEmail((String) newValue);
return;
case LobjPackage.AUTHOR__ID:
setId((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case LobjPackage.AUTHOR__CREDITTYPE:
setCredittype(CREDITTYPE_EDEFAULT);
return;
case LobjPackage.AUTHOR__PERSON:
setPerson((Person) null);
return;
case LobjPackage.AUTHOR__ADDRESS:
setAddress((Address) null);
return;
case LobjPackage.AUTHOR__EMAIL:
setEmail(EMAIL_EDEFAULT);
return;
case LobjPackage.AUTHOR__ID:
setId(ID_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case LobjPackage.AUTHOR__CREDITTYPE:
return CREDITTYPE_EDEFAULT == null ? credittype != null : !CREDITTYPE_EDEFAULT
.equals(credittype);
case LobjPackage.AUTHOR__PERSON:
return person != null;
case LobjPackage.AUTHOR__ADDRESS:
return address != null;
case LobjPackage.AUTHOR__EMAIL:
return EMAIL_EDEFAULT == null ? email != null : !EMAIL_EDEFAULT.equals(email);
case LobjPackage.AUTHOR__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (credittype: ");
result.append(credittype);
result.append(", email: ");
result.append(email);
result.append(", id: ");
result.append(id);
result.append(')');
return result.toString();
}
} // AuthorImpl