blob: f7876c76082edd5ea57b073a8dc4508fce7d2cbd [file] [log] [blame]
/*
* Copyright (c) 2007 Borland Software Corporation
*
* 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:
* Dmitry Stadnik (Borland) - initial API and implementation
*/
package org.eclipse.gmf.examples.taipan.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.EObjectImpl;
import org.eclipse.gmf.examples.taipan.BesiegePortOrder;
import org.eclipse.gmf.examples.taipan.Port;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Besiege Port Order</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.examples.taipan.impl.BesiegePortOrderImpl#getPort <em>Port</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class BesiegePortOrderImpl extends EObjectImpl implements BesiegePortOrder {
/**
* The cached value of the '{@link #getPort() <em>Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPort()
* @generated
* @ordered
*/
protected Port port;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected BesiegePortOrderImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TaiPanPackage.Literals.BESIEGE_PORT_ORDER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Port getPort() {
if (port != null && port.eIsProxy()) {
InternalEObject oldPort = (InternalEObject) port;
port = (Port) eResolveProxy(oldPort);
if (port != oldPort) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TaiPanPackage.BESIEGE_PORT_ORDER__PORT, oldPort, port));
}
}
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Port basicGetPort() {
return port;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPort(Port newPort) {
Port oldPort = port;
port = newPort;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TaiPanPackage.BESIEGE_PORT_ORDER__PORT, oldPort, port));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TaiPanPackage.BESIEGE_PORT_ORDER__PORT:
if (resolve)
return getPort();
return basicGetPort();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TaiPanPackage.BESIEGE_PORT_ORDER__PORT:
setPort((Port) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TaiPanPackage.BESIEGE_PORT_ORDER__PORT:
setPort((Port) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TaiPanPackage.BESIEGE_PORT_ORDER__PORT:
return port != null;
}
return super.eIsSet(featureID);
}
} //BesiegePortOrderImpl