diff -r 000000000000 -r 61163b28edca imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/iqrf/impl/ConfigurationElementImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/iqrf/impl/ConfigurationElementImpl.java Tue Jan 12 13:17:53 2010 -0600 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.s60tools.imaker.internal.iqrf.impl; + + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import com.nokia.s60tools.imaker.internal.iqrf.ConfigurationElement; +import com.nokia.s60tools.imaker.internal.iqrf.IQRFPackage; +import com.nokia.s60tools.imaker.internal.iqrf.util.IQRFUtil; + +/** + * + * An implementation of the model object 'Configuration Element'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class ConfigurationElementImpl extends EObjectImpl implements ConfigurationElement { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The default value of the '{@link #getValues() Values}' attribute. + * + * + * @see #getValues() + * @generated + * @ordered + */ + protected static final String VALUES_EDEFAULT = ""; + + /** + * The cached value of the '{@link #getValues() Values}' attribute. + * + * + * @see #getValues() + * @generated + * @ordered + */ + protected String values = VALUES_EDEFAULT; + + /** + * + * + * @generated + */ + protected ConfigurationElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + protected EClass eStaticClass() { + return IQRFPackage.Literals.CONFIGURATION_ELEMENT; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, IQRFPackage.CONFIGURATION_ELEMENT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public String getDescription() { + return description; + } + + /** + * + * + * @generated + */ + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, IQRFPackage.CONFIGURATION_ELEMENT__DESCRIPTION, oldDescription, description)); + } + + /** + * + * + * @generated + */ + public String getValues() { + return values; + } + + /** + * + * + * @generated + */ + public void setValues(String newValues) { + String oldValues = values; + values = newValues; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, IQRFPackage.CONFIGURATION_ELEMENT__VALUES, oldValues, values)); + } + + /** + * + * + * @generated + */ + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case IQRFPackage.CONFIGURATION_ELEMENT__NAME: + return getName(); + case IQRFPackage.CONFIGURATION_ELEMENT__DESCRIPTION: + return getDescription(); + case IQRFPackage.CONFIGURATION_ELEMENT__VALUES: + return getValues(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case IQRFPackage.CONFIGURATION_ELEMENT__NAME: + setName((String)newValue); + return; + case IQRFPackage.CONFIGURATION_ELEMENT__DESCRIPTION: + setDescription((String)newValue); + return; + case IQRFPackage.CONFIGURATION_ELEMENT__VALUES: + setValues((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + public void eUnset(int featureID) { + switch (featureID) { + case IQRFPackage.CONFIGURATION_ELEMENT__NAME: + setName(NAME_EDEFAULT); + return; + case IQRFPackage.CONFIGURATION_ELEMENT__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case IQRFPackage.CONFIGURATION_ELEMENT__VALUES: + setValues(VALUES_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + public boolean eIsSet(int featureID) { + switch (featureID) { + case IQRFPackage.CONFIGURATION_ELEMENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case IQRFPackage.CONFIGURATION_ELEMENT__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + case IQRFPackage.CONFIGURATION_ELEMENT__VALUES: + return VALUES_EDEFAULT == null ? values != null : !VALUES_EDEFAULT.equals(values); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", description: "); + result.append(description); + result.append(", values: "); + result.append(values); + result.append(')'); + return result.toString(); + } + + public boolean equals(Object object) { + if(object==null || !(object instanceof ConfigurationElement)) return false; + ConfigurationElement other = (ConfigurationElement)object; + return IQRFUtil.equals(getName(),other.getName()) && + IQRFUtil.equals(getDescription(),other.getDescription()) && + IQRFUtil.equals(getValues(),other.getValues()); + } + + @Override + public int hashCode() { + final int hashMultiplier = 41; + int result = 7; + result=result*hashMultiplier + getName().hashCode(); + result=result*hashMultiplier + getDescription().hashCode(); + result=result*hashMultiplier + getValues().hashCode(); + return result; + } +} //ConfigurationElementImpl \ No newline at end of file