| /******************************************************************************* |
| * 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.msproject.impl; |
| |
| import java.math.BigInteger; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.epf.msproject.MsprojectPackage; |
| import org.eclipse.epf.msproject.WBSMask; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>WBS Mask</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.epf.msproject.impl.WBSMaskImpl#getLevel <em>Level</em>}</li> |
| * <li>{@link org.eclipse.epf.msproject.impl.WBSMaskImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.epf.msproject.impl.WBSMaskImpl#getLength <em>Length</em>}</li> |
| * <li>{@link org.eclipse.epf.msproject.impl.WBSMaskImpl#getSeparator <em>Separator</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class WBSMaskImpl extends EObjectImpl implements WBSMask { |
| /** |
| * The default value of the '{@link #getLevel() <em>Level</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLevel() |
| * @generated |
| * @ordered |
| */ |
| protected static final BigInteger LEVEL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLevel() <em>Level</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLevel() |
| * @generated |
| * @ordered |
| */ |
| protected BigInteger level = LEVEL_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 BigInteger TYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected BigInteger type = TYPE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLength() <em>Length</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLength() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LENGTH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLength() <em>Length</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLength() |
| * @generated |
| * @ordered |
| */ |
| protected String length = LENGTH_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getSeparator() <em>Separator</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSeparator() |
| * @generated |
| * @ordered |
| */ |
| protected static final String SEPARATOR_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getSeparator() <em>Separator</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSeparator() |
| * @generated |
| * @ordered |
| */ |
| protected String separator = SEPARATOR_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected WBSMaskImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return MsprojectPackage.eINSTANCE.getWBSMask(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BigInteger getLevel() { |
| return level; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLevel(BigInteger newLevel) { |
| BigInteger oldLevel = level; |
| level = newLevel; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MsprojectPackage.WBS_MASK__LEVEL, oldLevel, level)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BigInteger getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(BigInteger newType) { |
| BigInteger oldType = type; |
| type = newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MsprojectPackage.WBS_MASK__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLength() { |
| return length; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLength(String newLength) { |
| String oldLength = length; |
| length = newLength; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MsprojectPackage.WBS_MASK__LENGTH, oldLength, length)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getSeparator() { |
| return separator; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSeparator(String newSeparator) { |
| String oldSeparator = separator; |
| separator = newSeparator; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MsprojectPackage.WBS_MASK__SEPARATOR, oldSeparator, separator)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(EStructuralFeature eFeature, boolean resolve) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case MsprojectPackage.WBS_MASK__LEVEL: |
| return getLevel(); |
| case MsprojectPackage.WBS_MASK__TYPE: |
| return getType(); |
| case MsprojectPackage.WBS_MASK__LENGTH: |
| return getLength(); |
| case MsprojectPackage.WBS_MASK__SEPARATOR: |
| return getSeparator(); |
| } |
| return eDynamicGet(eFeature, resolve); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(EStructuralFeature eFeature, Object newValue) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case MsprojectPackage.WBS_MASK__LEVEL: |
| setLevel((BigInteger)newValue); |
| return; |
| case MsprojectPackage.WBS_MASK__TYPE: |
| setType((BigInteger)newValue); |
| return; |
| case MsprojectPackage.WBS_MASK__LENGTH: |
| setLength((String)newValue); |
| return; |
| case MsprojectPackage.WBS_MASK__SEPARATOR: |
| setSeparator((String)newValue); |
| return; |
| } |
| eDynamicSet(eFeature, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case MsprojectPackage.WBS_MASK__LEVEL: |
| setLevel(LEVEL_EDEFAULT); |
| return; |
| case MsprojectPackage.WBS_MASK__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| case MsprojectPackage.WBS_MASK__LENGTH: |
| setLength(LENGTH_EDEFAULT); |
| return; |
| case MsprojectPackage.WBS_MASK__SEPARATOR: |
| setSeparator(SEPARATOR_EDEFAULT); |
| return; |
| } |
| eDynamicUnset(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case MsprojectPackage.WBS_MASK__LEVEL: |
| return LEVEL_EDEFAULT == null ? level != null : !LEVEL_EDEFAULT.equals(level); |
| case MsprojectPackage.WBS_MASK__TYPE: |
| return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); |
| case MsprojectPackage.WBS_MASK__LENGTH: |
| return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length); |
| case MsprojectPackage.WBS_MASK__SEPARATOR: |
| return SEPARATOR_EDEFAULT == null ? separator != null : !SEPARATOR_EDEFAULT.equals(separator); |
| } |
| return eDynamicIsSet(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (level: "); |
| result.append(level); |
| result.append(", type: "); |
| result.append(type); |
| result.append(", length: "); |
| result.append(length); |
| result.append(", separator: "); |
| result.append(separator); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //WBSMaskImpl |