/**
* Copyright (c) 2011 Cloudsmith Inc. and other contributors, as listed below.
* 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:
* Cloudsmith
*
*/
package org.cloudsmith.geppetto.pp.pptp.impl;
import org.cloudsmith.geppetto.pp.pptp.PPTPPackage;
import org.cloudsmith.geppetto.pp.pptp.Type;
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>Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.cloudsmith.geppetto.pp.pptp.impl.TypeImpl#getSuperType <em>Super Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TypeImpl extends AbstractTypeImpl implements Type {
/**
* The default value of the '{@link #getSuperType() <em>Super Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getSuperType()
* @generated
* @ordered
*/
protected static final String SUPER_TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getSuperType() <em>Super Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getSuperType()
* @generated
* @ordered
*/
protected String superType = SUPER_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected TypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch(featureID) {
case PPTPPackage.TYPE__SUPER_TYPE:
return getSuperType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch(featureID) {
case PPTPPackage.TYPE__SUPER_TYPE:
return SUPER_TYPE_EDEFAULT == null
? superType != null
: !SUPER_TYPE_EDEFAULT.equals(superType);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch(featureID) {
case PPTPPackage.TYPE__SUPER_TYPE:
setSuperType((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return PPTPPackage.Literals.TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch(featureID) {
case PPTPPackage.TYPE__SUPER_TYPE:
setSuperType(SUPER_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public String getSuperType() {
return superType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public void setSuperType(String newSuperType) {
String oldSuperType = superType;
superType = newSuperType;
if(eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PPTPPackage.TYPE__SUPER_TYPE, oldSuperType, superType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if(eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (superType: ");
result.append(superType);
result.append(')');
return result.toString();
}
} // TypeImpl