blob: e64d6657d449ddb2a5db789d0052534a131974b4 [file] [log] [blame]
/**
* Copyright (c) 2008-2011 Chair for Applied Software Engineering,
* Technische Universitaet Muenchen.
* 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:
*/
package org.eclipse.emf.emfstore.bowling.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 org.eclipse.emf.emfstore.bowling.Area;
import org.eclipse.emf.emfstore.bowling.BowlingPackage;
import org.eclipse.emf.emfstore.bowling.Tournament;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Area</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.emfstore.bowling.impl.AreaImpl#getAreas <em>Areas</em>}</li>
* <li>{@link org.eclipse.emf.emfstore.bowling.impl.AreaImpl#getTournaments <em>Tournaments</em>}</li>
* </ul>
*
* @generated
*/
public class AreaImpl extends EObjectImpl implements Area {
/**
* The cached value of the '{@link #getAreas() <em>Areas</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getAreas()
* @generated
* @ordered
*/
protected EList<Area> areas;
/**
* The cached value of the '{@link #getTournaments() <em>Tournaments</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getTournaments()
* @generated
* @ordered
*/
protected EList<Tournament> tournaments;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected AreaImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BowlingPackage.Literals.AREA;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public EList<Area> getAreas() {
if (areas == null) {
areas = new EObjectContainmentEList.Resolving<Area>(Area.class, this, BowlingPackage.AREA__AREAS);
}
return areas;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public EList<Tournament> getTournaments() {
if (tournaments == null) {
tournaments = new EObjectContainmentEList.Resolving<Tournament>(Tournament.class, this,
BowlingPackage.AREA__TOURNAMENTS);
}
return tournaments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BowlingPackage.AREA__AREAS:
return ((InternalEList<?>) getAreas()).basicRemove(otherEnd, msgs);
case BowlingPackage.AREA__TOURNAMENTS:
return ((InternalEList<?>) getTournaments()).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 BowlingPackage.AREA__AREAS:
return getAreas();
case BowlingPackage.AREA__TOURNAMENTS:
return getTournaments();
}
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 BowlingPackage.AREA__AREAS:
getAreas().clear();
getAreas().addAll((Collection<? extends Area>) newValue);
return;
case BowlingPackage.AREA__TOURNAMENTS:
getTournaments().clear();
getTournaments().addAll((Collection<? extends Tournament>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BowlingPackage.AREA__AREAS:
getAreas().clear();
return;
case BowlingPackage.AREA__TOURNAMENTS:
getTournaments().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BowlingPackage.AREA__AREAS:
return areas != null && !areas.isEmpty();
case BowlingPackage.AREA__TOURNAMENTS:
return tournaments != null && !tournaments.isEmpty();
}
return super.eIsSet(featureID);
}
} // AreaImpl