sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/ButtonEventProfileListTypeImpl.java
changeset 2 b9ab3b238396
child 12 ae255c9aa552
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.impl;
       
    19 
       
    20 import java.math.BigDecimal;
       
    21 import java.util.Collection;
       
    22 
       
    23 import org.eclipse.emf.common.notify.Notification;
       
    24 import org.eclipse.emf.common.notify.NotificationChain;
       
    25 import org.eclipse.emf.common.util.EList;
       
    26 import org.eclipse.emf.ecore.EClass;
       
    27 import org.eclipse.emf.ecore.InternalEObject;
       
    28 import org.eclipse.emf.ecore.impl.ENotificationImpl;
       
    29 import org.eclipse.emf.ecore.impl.EObjectImpl;
       
    30 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
       
    31 import org.eclipse.emf.ecore.util.InternalEList;
       
    32 
       
    33 import com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.ButtonEventProfileListType;
       
    34 import com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.ButtonEventProfileType;
       
    35 import com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.PIConfigPackage;
       
    36 
       
    37 /**
       
    38  * <!-- begin-user-doc -->
       
    39  * An implementation of the model object '<em><b>Button Event Profile List Type</b></em>'.
       
    40  * <!-- end-user-doc -->
       
    41  * <p>
       
    42  * The following features are implemented:
       
    43  * <ul>
       
    44  *   <li>{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.ButtonEventProfileListTypeImpl#getButtonEventProfile <em>Button Event Profile</em>}</li>
       
    45  *   <li>{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.ButtonEventProfileListTypeImpl#getButtonEventProfileVersion <em>Button Event Profile Version</em>}</li>
       
    46  * </ul>
       
    47  * </p>
       
    48  *
       
    49  * @generated
       
    50  */
       
    51 public class ButtonEventProfileListTypeImpl extends EObjectImpl implements ButtonEventProfileListType {
       
    52 	/**
       
    53 	 * The cached value of the '{@link #getButtonEventProfile() <em>Button Event Profile</em>}' containment reference list.
       
    54 	 * <!-- begin-user-doc -->
       
    55 	 * <!-- end-user-doc -->
       
    56 	 * @see #getButtonEventProfile()
       
    57 	 * @generated
       
    58 	 * @ordered
       
    59 	 */
       
    60 	protected EList<ButtonEventProfileType> buttonEventProfile;
       
    61 
       
    62 	/**
       
    63 	 * The default value of the '{@link #getButtonEventProfileVersion() <em>Button Event Profile Version</em>}' attribute.
       
    64 	 * <!-- begin-user-doc -->
       
    65 	 * <!-- end-user-doc -->
       
    66 	 * @see #getButtonEventProfileVersion()
       
    67 	 * @generated
       
    68 	 * @ordered
       
    69 	 */
       
    70 	protected static final BigDecimal BUTTON_EVENT_PROFILE_VERSION_EDEFAULT = null;
       
    71 
       
    72 	/**
       
    73 	 * The cached value of the '{@link #getButtonEventProfileVersion() <em>Button Event Profile Version</em>}' attribute.
       
    74 	 * <!-- begin-user-doc -->
       
    75 	 * <!-- end-user-doc -->
       
    76 	 * @see #getButtonEventProfileVersion()
       
    77 	 * @generated
       
    78 	 * @ordered
       
    79 	 */
       
    80 	protected BigDecimal buttonEventProfileVersion = BUTTON_EVENT_PROFILE_VERSION_EDEFAULT;
       
    81 
       
    82 	/**
       
    83 	 * <!-- begin-user-doc -->
       
    84 	 * <!-- end-user-doc -->
       
    85 	 * @generated
       
    86 	 */
       
    87 	protected ButtonEventProfileListTypeImpl() {
       
    88 		super();
       
    89 	}
       
    90 
       
    91 	/**
       
    92 	 * <!-- begin-user-doc -->
       
    93 	 * <!-- end-user-doc -->
       
    94 	 * @generated
       
    95 	 */
       
    96 	@Override
       
    97 	protected EClass eStaticClass() {
       
    98 		return PIConfigPackage.Literals.BUTTON_EVENT_PROFILE_LIST_TYPE;
       
    99 	}
       
   100 
       
   101 	/**
       
   102 	 * <!-- begin-user-doc -->
       
   103 	 * <!-- end-user-doc -->
       
   104 	 * @generated
       
   105 	 */
       
   106 	public EList<ButtonEventProfileType> getButtonEventProfile() {
       
   107 		if (buttonEventProfile == null) {
       
   108 			buttonEventProfile = new EObjectContainmentEList<ButtonEventProfileType>(ButtonEventProfileType.class, this, PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE);
       
   109 		}
       
   110 		return buttonEventProfile;
       
   111 	}
       
   112 
       
   113 	/**
       
   114 	 * <!-- begin-user-doc -->
       
   115 	 * <!-- end-user-doc -->
       
   116 	 * @generated
       
   117 	 */
       
   118 	public BigDecimal getButtonEventProfileVersion() {
       
   119 		return buttonEventProfileVersion;
       
   120 	}
       
   121 
       
   122 	/**
       
   123 	 * <!-- begin-user-doc -->
       
   124 	 * <!-- end-user-doc -->
       
   125 	 * @generated
       
   126 	 */
       
   127 	public void setButtonEventProfileVersion(BigDecimal newButtonEventProfileVersion) {
       
   128 		BigDecimal oldButtonEventProfileVersion = buttonEventProfileVersion;
       
   129 		buttonEventProfileVersion = newButtonEventProfileVersion;
       
   130 		if (eNotificationRequired())
       
   131 			eNotify(new ENotificationImpl(this, Notification.SET, PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION, oldButtonEventProfileVersion, buttonEventProfileVersion));
       
   132 	}
       
   133 
       
   134 	/**
       
   135 	 * <!-- begin-user-doc -->
       
   136 	 * <!-- end-user-doc -->
       
   137 	 * @generated
       
   138 	 */
       
   139 	@Override
       
   140 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
       
   141 		switch (featureID) {
       
   142 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
       
   143 				return ((InternalEList<?>)getButtonEventProfile()).basicRemove(otherEnd, msgs);
       
   144 		}
       
   145 		return super.eInverseRemove(otherEnd, featureID, msgs);
       
   146 	}
       
   147 
       
   148 	/**
       
   149 	 * <!-- begin-user-doc -->
       
   150 	 * <!-- end-user-doc -->
       
   151 	 * @generated
       
   152 	 */
       
   153 	@Override
       
   154 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
       
   155 		switch (featureID) {
       
   156 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
       
   157 				return getButtonEventProfile();
       
   158 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
       
   159 				return getButtonEventProfileVersion();
       
   160 		}
       
   161 		return super.eGet(featureID, resolve, coreType);
       
   162 	}
       
   163 
       
   164 	/**
       
   165 	 * <!-- begin-user-doc -->
       
   166 	 * <!-- end-user-doc -->
       
   167 	 * @generated
       
   168 	 */
       
   169 	@SuppressWarnings("unchecked")
       
   170 	@Override
       
   171 	public void eSet(int featureID, Object newValue) {
       
   172 		switch (featureID) {
       
   173 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
       
   174 				getButtonEventProfile().clear();
       
   175 				getButtonEventProfile().addAll((Collection<? extends ButtonEventProfileType>)newValue);
       
   176 				return;
       
   177 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
       
   178 				setButtonEventProfileVersion((BigDecimal)newValue);
       
   179 				return;
       
   180 		}
       
   181 		super.eSet(featureID, newValue);
       
   182 	}
       
   183 
       
   184 	/**
       
   185 	 * <!-- begin-user-doc -->
       
   186 	 * <!-- end-user-doc -->
       
   187 	 * @generated
       
   188 	 */
       
   189 	@Override
       
   190 	public void eUnset(int featureID) {
       
   191 		switch (featureID) {
       
   192 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
       
   193 				getButtonEventProfile().clear();
       
   194 				return;
       
   195 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
       
   196 				setButtonEventProfileVersion(BUTTON_EVENT_PROFILE_VERSION_EDEFAULT);
       
   197 				return;
       
   198 		}
       
   199 		super.eUnset(featureID);
       
   200 	}
       
   201 
       
   202 	/**
       
   203 	 * <!-- begin-user-doc -->
       
   204 	 * <!-- end-user-doc -->
       
   205 	 * @generated
       
   206 	 */
       
   207 	@Override
       
   208 	public boolean eIsSet(int featureID) {
       
   209 		switch (featureID) {
       
   210 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
       
   211 				return buttonEventProfile != null && !buttonEventProfile.isEmpty();
       
   212 			case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
       
   213 				return BUTTON_EVENT_PROFILE_VERSION_EDEFAULT == null ? buttonEventProfileVersion != null : !BUTTON_EVENT_PROFILE_VERSION_EDEFAULT.equals(buttonEventProfileVersion);
       
   214 		}
       
   215 		return super.eIsSet(featureID);
       
   216 	}
       
   217 
       
   218 	/**
       
   219 	 * <!-- begin-user-doc -->
       
   220 	 * <!-- end-user-doc -->
       
   221 	 * @generated
       
   222 	 */
       
   223 	@Override
       
   224 	public String toString() {
       
   225 		if (eIsProxy()) return super.toString();
       
   226 
       
   227 		StringBuffer result = new StringBuffer(super.toString());
       
   228 		result.append(" (buttonEventProfileVersion: ");
       
   229 		result.append(buttonEventProfileVersion);
       
   230 		result.append(')');
       
   231 		return result.toString();
       
   232 	}
       
   233 
       
   234 } //ButtonEventProfileListTypeImpl