/** | |
* Copyright (c) 2009, 2011 Mia-Software. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.html | |
* | |
* Contributors: | |
* Gregoire DUPE (Mia-Software) - initial API and implementation | |
* Gregoire DUPE (Mia-Software) - Bug 341752 - Extract report metamodel from the benchmark plug-in to avoid Acceleo troubles. | |
* Nicolas Bros (Mia-Software) | |
* | |
*/ | |
package org.eclipse.modisco.infra.discovery.benchmark.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.modisco.infra.discovery.benchmark.BenchmarkPackage; | |
import org.eclipse.modisco.infra.discovery.benchmark.DiscoveredProject; | |
import org.eclipse.modisco.infra.discovery.benchmark.MultiProjectBenchmark; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Multi Project Benchmark</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.impl.MultiProjectBenchmarkImpl#getProjects <em>Projects</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class MultiProjectBenchmarkImpl extends BenchmarkImpl implements MultiProjectBenchmark { | |
/** | |
* The cached value of the '{@link #getProjects() <em>Projects</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjects() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<DiscoveredProject> projects; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected MultiProjectBenchmarkImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return BenchmarkPackage.Literals.MULTI_PROJECT_BENCHMARK; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EList<DiscoveredProject> getProjects() { | |
if (projects == null) { | |
projects = new EObjectContainmentEList<DiscoveredProject>(DiscoveredProject.class, this, BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS); | |
} | |
return projects; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS: | |
return ((InternalEList<?>)getProjects()).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 BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS: | |
return getProjects(); | |
} | |
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 BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS: | |
getProjects().clear(); | |
getProjects().addAll((Collection<? extends DiscoveredProject>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS: | |
getProjects().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case BenchmarkPackage.MULTI_PROJECT_BENCHMARK__PROJECTS: | |
return projects != null && !projects.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //MultiProjectBenchmarkImpl |