/*
* Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
* 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:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.emf.cdo.tests.legacy.model4.impl;
import org.eclipse.emf.cdo.tests.legacy.model4.model4Package;
import org.eclipse.emf.cdo.tests.model4.GenRefMultiNonContained;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import java.util.Collection;
/**
* An implementation of the model object 'Gen Ref Multi Non Contained'.
*
* The following features are implemented:
*
* - {@link org.eclipse.emf.cdo.tests.legacy.model4.impl.GenRefMultiNonContainedImpl#getElements Elements}
*
*
*
* @generated
*/
public class GenRefMultiNonContainedImpl extends EObjectImpl implements GenRefMultiNonContained
{
/**
* The cached value of the '{@link #getElements() Elements}' reference list.
*
* @see #getElements()
* @generated
* @ordered
*/
protected EList elements;
/**
*
*
* @generated
*/
protected GenRefMultiNonContainedImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return model4Package.eINSTANCE.getGenRefMultiNonContained();
}
/**
*
*
* @generated
*/
public EList getElements()
{
if (elements == null)
{
elements = new EObjectResolvingEList(EObject.class, this,
model4Package.GEN_REF_MULTI_NON_CONTAINED__ELEMENTS);
}
return elements;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case model4Package.GEN_REF_MULTI_NON_CONTAINED__ELEMENTS:
return getElements();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case model4Package.GEN_REF_MULTI_NON_CONTAINED__ELEMENTS:
getElements().clear();
getElements().addAll((Collection extends EObject>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case model4Package.GEN_REF_MULTI_NON_CONTAINED__ELEMENTS:
getElements().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case model4Package.GEN_REF_MULTI_NON_CONTAINED__ELEMENTS:
return elements != null && !elements.isEmpty();
}
return super.eIsSet(featureID);
}
} // GenRefMultiNonContainedImpl