/* license-start
*
* Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, at <http://www.gnu.org/licenses/>.
*
* Contributors:
* Crispico - Initial API and implementation
*
* license-end
*/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.crispico.flower.mp.model.astcache.code.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage;
import com.crispico.flower.mp.model.astcache.code.ExtendedModifier;
import com.crispico.flower.mp.model.astcache.code.ModifiableElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Modifiable Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.crispico.flower.mp.model.astcache.code.impl.ModifiableElementImpl#getModifiers <em>Modifiers</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ModifiableElementImpl extends EObjectImpl implements ModifiableElement {
/**
* The cached value of the '{@link #getModifiers() <em>Modifiers</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModifiers()
* @generated
* @ordered
*/
protected EList<ExtendedModifier> modifiers;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModifiableElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AstCacheCodePackage.Literals.MODIFIABLE_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ExtendedModifier> getModifiers() {
if (modifiers == null) {
modifiers = new EObjectContainmentEList<ExtendedModifier>(ExtendedModifier.class, this, AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS);
}
return modifiers;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS:
return ((InternalEList<?>)getModifiers()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS:
return getModifiers();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS:
getModifiers().clear();
getModifiers().addAll((Collection<? extends ExtendedModifier>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS:
getModifiers().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AstCacheCodePackage.MODIFIABLE_ELEMENT__MODIFIERS:
return modifiers != null && !modifiers.isEmpty();
}
return super.eIsSet(featureID);
}
} //ModifiableElementImpl