/**
*/
package net.cis.common.model.shipdevice.impl;
import net.cis.common.model.base.impl.AbstractNamedEntityImpl;
import net.cis.common.model.shipdevice.AbstractShipDevice;
import net.cis.common.model.shipdevice.ShipdevicePackage;
import net.cis.common.model.shipdevice.SlotSize;
import net.cis.common.model.shipdevice.SlotType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Abstract Ship Device</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link net.cis.common.model.shipdevice.impl.AbstractShipDeviceImpl#getWeight <em>Weight</em>}</li>
* <li>{@link net.cis.common.model.shipdevice.impl.AbstractShipDeviceImpl#getSize <em>Size</em>}</li>
* <li>{@link net.cis.common.model.shipdevice.impl.AbstractShipDeviceImpl#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class AbstractShipDeviceImpl extends AbstractNamedEntityImpl implements AbstractShipDevice {
/**
* The default value of the '{@link #getWeight() <em>Weight</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWeight()
* @generated
* @ordered
*/
protected static final float WEIGHT_EDEFAULT = 0.0F;
/**
* The cached value of the '{@link #getWeight() <em>Weight</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWeight()
* @generated
* @ordered
*/
protected float weight = WEIGHT_EDEFAULT;
/**
* The default value of the '{@link #getSize() <em>Size</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSize()
* @generated
* @ordered
*/
protected static final SlotSize SIZE_EDEFAULT = SlotSize.TINY;
/**
* The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSize()
* @generated
* @ordered
*/
protected SlotSize size = SIZE_EDEFAULT;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final SlotType TYPE_EDEFAULT = SlotType.SHIELD;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected SlotType type = TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AbstractShipDeviceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ShipdevicePackage.Literals.ABSTRACT_SHIP_DEVICE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public float getWeight() {
return weight;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setWeight(float newWeight) {
float oldWeight = weight;
weight = newWeight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ShipdevicePackage.ABSTRACT_SHIP_DEVICE__WEIGHT, oldWeight, weight));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SlotSize getSize() {
return size;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSize(SlotSize newSize) {
SlotSize oldSize = size;
size = newSize == null ? SIZE_EDEFAULT : newSize;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ShipdevicePackage.ABSTRACT_SHIP_DEVICE__SIZE, oldSize, size));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SlotType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(SlotType newType) {
SlotType oldType = type;
type = newType == null ? TYPE_EDEFAULT : newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ShipdevicePackage.ABSTRACT_SHIP_DEVICE__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__WEIGHT:
return getWeight();
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__SIZE:
return getSize();
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__WEIGHT:
setWeight((Float)newValue);
return;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__SIZE:
setSize((SlotSize)newValue);
return;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__TYPE:
setType((SlotType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__WEIGHT:
setWeight(WEIGHT_EDEFAULT);
return;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__SIZE:
setSize(SIZE_EDEFAULT);
return;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__TYPE:
setType(TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__WEIGHT:
return weight != WEIGHT_EDEFAULT;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__SIZE:
return size != SIZE_EDEFAULT;
case ShipdevicePackage.ABSTRACT_SHIP_DEVICE__TYPE:
return type != TYPE_EDEFAULT;
}
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(" (weight: ");
result.append(weight);
result.append(", size: ");
result.append(size);
result.append(", type: ");
result.append(type);
result.append(')');
return result.toString();
}
} //AbstractShipDeviceImpl