blob: 4ce2c19038f8f6f9a7fcf07681c24af5e2e67dbb [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2008 Hatha Systems.
* 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:
* Nikolai Mansourov (Hatha Systems) - initial API and implementation
* *******************************************************************************
*
* $Id$
*/
package org.eclipse.gmt.modisco.omg.kdm.platform.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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KDMModelImpl;
import org.eclipse.gmt.modisco.omg.kdm.platform.AbstractPlatformElement;
import org.eclipse.gmt.modisco.omg.kdm.platform.PlatformModel;
import org.eclipse.gmt.modisco.omg.kdm.platform.PlatformPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Model</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.platform.impl.PlatformModelImpl#getPlatformElement <em>Platform Element</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PlatformModelImpl extends KDMModelImpl implements PlatformModel {
/**
* The cached value of the '{@link #getPlatformElement() <em>Platform Element</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPlatformElement()
* @generated
* @ordered
*/
protected EList<AbstractPlatformElement> platformElement;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PlatformModelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PlatformPackage.Literals.PLATFORM_MODEL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<AbstractPlatformElement> getPlatformElement() {
if (platformElement == null) {
platformElement = new EObjectContainmentEList<AbstractPlatformElement>(AbstractPlatformElement.class, this, PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT);
}
return platformElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT:
return ((InternalEList<?>)getPlatformElement()).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 PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT:
return getPlatformElement();
}
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 PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT:
getPlatformElement().clear();
getPlatformElement().addAll((Collection<? extends AbstractPlatformElement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT:
getPlatformElement().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PlatformPackage.PLATFORM_MODEL__PLATFORM_ELEMENT:
return platformElement != null && !platformElement.isEmpty();
}
return super.eIsSet(featureID);
}
} //PlatformModelImpl