/**
*/
package org.archstudio.xadl3.structure_3_0.impl;
import java.util.Collection;
import org.archstudio.xadl3.structure_3_0.Interface;
import org.archstudio.xadl3.structure_3_0.Link;
import org.archstudio.xadl3.structure_3_0.Structure_3_0Package;
import org.archstudio.xadl3.xadlcore_3_0.Extension;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Link</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.archstudio.xadl3.structure_3_0.impl.LinkImpl#getPoint1 <em>Point1</em>}</li>
* <li>{@link org.archstudio.xadl3.structure_3_0.impl.LinkImpl#getPoint2 <em>Point2</em>}</li>
* <li>{@link org.archstudio.xadl3.structure_3_0.impl.LinkImpl#getExt <em>Ext</em>}</li>
* <li>{@link org.archstudio.xadl3.structure_3_0.impl.LinkImpl#getId <em>Id</em>}</li>
* <li>{@link org.archstudio.xadl3.structure_3_0.impl.LinkImpl#getName <em>Name</em>}</li>
* </ul>
*
* @generated
*/
public class LinkImpl extends MinimalEObjectImpl.Container implements Link {
/**
* The cached value of the '{@link #getPoint1() <em>Point1</em>}' reference. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getPoint1()
* @generated
* @ordered
*/
protected Interface point1;
/**
* The cached value of the '{@link #getPoint2() <em>Point2</em>}' reference. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getPoint2()
* @generated
* @ordered
*/
protected Interface point2;
/**
* The cached value of the '{@link #getExt() <em>Ext</em>}' containment reference list. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getExt()
* @generated
* @ordered
*/
protected EList<Extension> ext;
/**
* 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;
/**
* 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;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected LinkImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Structure_3_0Package.Literals.LINK;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Interface getPoint1() {
return point1;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setPoint1(Interface newPoint1) {
Interface oldPoint1 = point1;
point1 = newPoint1;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Structure_3_0Package.LINK__POINT1, oldPoint1,
point1));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Interface getPoint2() {
return point2;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setPoint2(Interface newPoint2) {
Interface oldPoint2 = point2;
point2 = newPoint2;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Structure_3_0Package.LINK__POINT2, oldPoint2,
point2));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<Extension> getExt() {
if (ext == null) {
ext = new EObjectContainmentEList<Extension>(Extension.class, this, Structure_3_0Package.LINK__EXT);
}
return ext;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getId() {
return id;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Structure_3_0Package.LINK__ID, oldId, id));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getName() {
return name;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Structure_3_0Package.LINK__NAME, oldName, name));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Structure_3_0Package.LINK__EXT:
return ((InternalEList<?>) getExt()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Structure_3_0Package.LINK__POINT1:
return getPoint1();
case Structure_3_0Package.LINK__POINT2:
return getPoint2();
case Structure_3_0Package.LINK__EXT:
return getExt();
case Structure_3_0Package.LINK__ID:
return getId();
case Structure_3_0Package.LINK__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Structure_3_0Package.LINK__POINT1:
setPoint1((Interface) newValue);
return;
case Structure_3_0Package.LINK__POINT2:
setPoint2((Interface) newValue);
return;
case Structure_3_0Package.LINK__EXT:
getExt().clear();
getExt().addAll((Collection<? extends Extension>) newValue);
return;
case Structure_3_0Package.LINK__ID:
setId((String) newValue);
return;
case Structure_3_0Package.LINK__NAME:
setName((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Structure_3_0Package.LINK__POINT1:
setPoint1((Interface) null);
return;
case Structure_3_0Package.LINK__POINT2:
setPoint2((Interface) null);
return;
case Structure_3_0Package.LINK__EXT:
getExt().clear();
return;
case Structure_3_0Package.LINK__ID:
setId(ID_EDEFAULT);
return;
case Structure_3_0Package.LINK__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Structure_3_0Package.LINK__POINT1:
return point1 != null;
case Structure_3_0Package.LINK__POINT2:
return point2 != null;
case Structure_3_0Package.LINK__EXT:
return ext != null && !ext.isEmpty();
case Structure_3_0Package.LINK__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case Structure_3_0Package.LINK__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
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(" (id: ");
result.append(id);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} // LinkImpl