/**
*/
package com.perforce.example.p4dsl.p4Dsl.impl;
import com.perforce.example.p4dsl.p4Dsl.Command;
import com.perforce.example.p4dsl.p4Dsl.Model;
import com.perforce.example.p4dsl.p4Dsl.P4DslPackage;
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.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- 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 com.perforce.example.p4dsl.p4Dsl.impl.ModelImpl#getCommand <em>Command</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ModelImpl extends MinimalEObjectImpl.Container implements Model
{
/**
* The cached value of the '{@link #getCommand() <em>Command</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCommand()
* @generated
* @ordered
*/
protected EList<Command> command;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModelImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return P4DslPackage.Literals.MODEL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Command> getCommand()
{
if (command == null)
{
command = new EObjectContainmentEList<Command>(Command.class, this, P4DslPackage.MODEL__COMMAND);
}
return command;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case P4DslPackage.MODEL__COMMAND:
return ((InternalEList<?>)getCommand()).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 P4DslPackage.MODEL__COMMAND:
return getCommand();
}
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 P4DslPackage.MODEL__COMMAND:
getCommand().clear();
getCommand().addAll((Collection<? extends Command>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case P4DslPackage.MODEL__COMMAND:
getCommand().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case P4DslPackage.MODEL__COMMAND:
return command != null && !command.isEmpty();
}
return super.eIsSet(featureID);
}
} //ModelImpl
# |
Change |
User |
Description |
Committed |
|
#1
|
8258 |
Liz Lam |
Initial add of p4dsl - an exploration of Xtext using the p4 command line as an example. |
|
|