/******************************************************************************* * Copyright (c) 2005, 2009 IBM Corporation and others. * 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: * IBM Corporation - initial implementation *******************************************************************************/ package org.eclipse.epf.xml.uma.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.epf.uma.ecore.impl.MultiResourceEObject; import org.eclipse.epf.xml.uma.UmaPackage; import org.eclipse.epf.xml.uma.WorkOrder; import org.eclipse.epf.xml.uma.WorkOrderType; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Work Order</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.epf.xml.uma.impl.WorkOrderImpl#getValue <em>Value</em>}</li> * <li>{@link org.eclipse.epf.xml.uma.impl.WorkOrderImpl#getId <em>Id</em>}</li> * <li>{@link org.eclipse.epf.xml.uma.impl.WorkOrderImpl#getLinkType <em>Link Type</em>}</li> * <li>{@link org.eclipse.epf.xml.uma.impl.WorkOrderImpl#getProperties <em>Properties</em>}</li> * </ul> * </p> * * @generated */ public class WorkOrderImpl extends MultiResourceEObject implements WorkOrder { /** * The default value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected static final String VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected String value = VALUE_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; /** * The default value of the '{@link #getLinkType() <em>Link Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLinkType() * @generated * @ordered */ protected static final WorkOrderType LINK_TYPE_EDEFAULT = WorkOrderType.FINISH_TO_START; /** * The cached value of the '{@link #getLinkType() <em>Link Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLinkType() * @generated * @ordered */ protected WorkOrderType linkType = LINK_TYPE_EDEFAULT; /** * This is true if the Link Type attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean linkTypeESet; /** * The default value of the '{@link #getProperties() <em>Properties</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperties() * @generated * @ordered */ protected static final String PROPERTIES_EDEFAULT = null; /** * The cached value of the '{@link #getProperties() <em>Properties</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperties() * @generated * @ordered */ protected String properties = PROPERTIES_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected WorkOrderImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return UmaPackage.Literals.WORK_ORDER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(String newValue) { String oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_ORDER__VALUE, oldValue, value)); } /** * <!-- 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, UmaPackage.WORK_ORDER__ID, oldId, id)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public WorkOrderType getLinkType() { return linkType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLinkType(WorkOrderType newLinkType) { WorkOrderType oldLinkType = linkType; linkType = newLinkType == null ? LINK_TYPE_EDEFAULT : newLinkType; boolean oldLinkTypeESet = linkTypeESet; linkTypeESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_ORDER__LINK_TYPE, oldLinkType, linkType, !oldLinkTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetLinkType() { WorkOrderType oldLinkType = linkType; boolean oldLinkTypeESet = linkTypeESet; linkType = LINK_TYPE_EDEFAULT; linkTypeESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, UmaPackage.WORK_ORDER__LINK_TYPE, oldLinkType, LINK_TYPE_EDEFAULT, oldLinkTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetLinkType() { return linkTypeESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getProperties() { return properties; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperties(String newProperties) { String oldProperties = properties; properties = newProperties; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_ORDER__PROPERTIES, oldProperties, properties)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UmaPackage.WORK_ORDER__VALUE: return getValue(); case UmaPackage.WORK_ORDER__ID: return getId(); case UmaPackage.WORK_ORDER__LINK_TYPE: return getLinkType(); case UmaPackage.WORK_ORDER__PROPERTIES: return getProperties(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case UmaPackage.WORK_ORDER__VALUE: setValue((String)newValue); return; case UmaPackage.WORK_ORDER__ID: setId((String)newValue); return; case UmaPackage.WORK_ORDER__LINK_TYPE: setLinkType((WorkOrderType)newValue); return; case UmaPackage.WORK_ORDER__PROPERTIES: setProperties((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case UmaPackage.WORK_ORDER__VALUE: setValue(VALUE_EDEFAULT); return; case UmaPackage.WORK_ORDER__ID: setId(ID_EDEFAULT); return; case UmaPackage.WORK_ORDER__LINK_TYPE: unsetLinkType(); return; case UmaPackage.WORK_ORDER__PROPERTIES: setProperties(PROPERTIES_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UmaPackage.WORK_ORDER__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); case UmaPackage.WORK_ORDER__ID: return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); case UmaPackage.WORK_ORDER__LINK_TYPE: return isSetLinkType(); case UmaPackage.WORK_ORDER__PROPERTIES: return PROPERTIES_EDEFAULT == null ? properties != null : !PROPERTIES_EDEFAULT.equals(properties); } 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(" (value: "); result.append(value); result.append(", id: "); result.append(id); result.append(", linkType: "); if (linkTypeESet) result.append(linkType); else result.append("<unset>"); result.append(", properties: "); result.append(properties); result.append(')'); return result.toString(); } } //WorkOrderImpl