![JAR search and dependency download from the Maven repository](/logo.png)
org.contextmapper.tactic.dsl.tacticdsl.impl.TraitImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of context-mapper-dsl Show documentation
Show all versions of context-mapper-dsl Show documentation
Use the ContextMapper DSL in your standalone application.
/**
* generated by Xtext 2.20.0
*/
package org.contextmapper.tactic.dsl.tacticdsl.impl;
import java.util.Collection;
import org.contextmapper.tactic.dsl.tacticdsl.Attribute;
import org.contextmapper.tactic.dsl.tacticdsl.DomainObjectOperation;
import org.contextmapper.tactic.dsl.tacticdsl.Reference;
import org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage;
import org.contextmapper.tactic.dsl.tacticdsl.Trait;
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;
/**
*
* An implementation of the model object 'Trait'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.TraitImpl#getAttributes Attributes}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.TraitImpl#getReferences References}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.TraitImpl#getOperations Operations}
*
*
* @generated
*/
public class TraitImpl extends SimpleDomainObjectImpl implements Trait
{
/**
* The cached value of the '{@link #getAttributes() Attributes}' containment reference list.
*
*
* @see #getAttributes()
* @generated
* @ordered
*/
protected EList attributes;
/**
* The cached value of the '{@link #getReferences() References}' containment reference list.
*
*
* @see #getReferences()
* @generated
* @ordered
*/
protected EList references;
/**
* The cached value of the '{@link #getOperations() Operations}' containment reference list.
*
*
* @see #getOperations()
* @generated
* @ordered
*/
protected EList operations;
/**
*
*
* @generated
*/
protected TraitImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TacticdslPackage.Literals.TRAIT;
}
/**
*
*
* @generated
*/
public EList getAttributes()
{
if (attributes == null)
{
attributes = new EObjectContainmentEList(Attribute.class, this, TacticdslPackage.TRAIT__ATTRIBUTES);
}
return attributes;
}
/**
*
*
* @generated
*/
public EList getReferences()
{
if (references == null)
{
references = new EObjectContainmentEList(Reference.class, this, TacticdslPackage.TRAIT__REFERENCES);
}
return references;
}
/**
*
*
* @generated
*/
public EList getOperations()
{
if (operations == null)
{
operations = new EObjectContainmentEList(DomainObjectOperation.class, this, TacticdslPackage.TRAIT__OPERATIONS);
}
return operations;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case TacticdslPackage.TRAIT__ATTRIBUTES:
return ((InternalEList>)getAttributes()).basicRemove(otherEnd, msgs);
case TacticdslPackage.TRAIT__REFERENCES:
return ((InternalEList>)getReferences()).basicRemove(otherEnd, msgs);
case TacticdslPackage.TRAIT__OPERATIONS:
return ((InternalEList>)getOperations()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TacticdslPackage.TRAIT__ATTRIBUTES:
return getAttributes();
case TacticdslPackage.TRAIT__REFERENCES:
return getReferences();
case TacticdslPackage.TRAIT__OPERATIONS:
return getOperations();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TacticdslPackage.TRAIT__ATTRIBUTES:
getAttributes().clear();
getAttributes().addAll((Collection extends Attribute>)newValue);
return;
case TacticdslPackage.TRAIT__REFERENCES:
getReferences().clear();
getReferences().addAll((Collection extends Reference>)newValue);
return;
case TacticdslPackage.TRAIT__OPERATIONS:
getOperations().clear();
getOperations().addAll((Collection extends DomainObjectOperation>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TacticdslPackage.TRAIT__ATTRIBUTES:
getAttributes().clear();
return;
case TacticdslPackage.TRAIT__REFERENCES:
getReferences().clear();
return;
case TacticdslPackage.TRAIT__OPERATIONS:
getOperations().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TacticdslPackage.TRAIT__ATTRIBUTES:
return attributes != null && !attributes.isEmpty();
case TacticdslPackage.TRAIT__REFERENCES:
return references != null && !references.isEmpty();
case TacticdslPackage.TRAIT__OPERATIONS:
return operations != null && !operations.isEmpty();
}
return super.eIsSet(featureID);
}
} //TraitImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy