diff options
Diffstat (limited to 'rba.model.core/src/rba/core/impl/ContentSetImpl.java')
-rw-r--r-- | rba.model.core/src/rba/core/impl/ContentSetImpl.java | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/rba.model.core/src/rba/core/impl/ContentSetImpl.java b/rba.model.core/src/rba/core/impl/ContentSetImpl.java new file mode 100644 index 0000000..48b49dc --- /dev/null +++ b/rba.model.core/src/rba/core/impl/ContentSetImpl.java @@ -0,0 +1,177 @@ +/** + */ +package rba.core.impl; + +import java.lang.reflect.InvocationTargetException; +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.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; +import rba.core.AbstractContent; +import rba.core.Content; +import rba.core.ContentSet; +import rba.core.RBACorePackage; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Content Set</b></em>'. <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link rba.core.impl.ContentSetImpl#getTarget <em>Target</em>}</li> + * </ul> + * + * @generated + */ +public abstract class ContentSetImpl extends AbstractContentImpl implements ContentSet { + /** + * The cached value of the '{@link #getTarget() <em>Target</em>}' reference list. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * @see #getTarget() + * @generated + * @ordered + */ + protected EList<AbstractContent> target; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected ContentSetImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBACorePackage.Literals.CONTENT_SET; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public EList<AbstractContent> getTarget() { + if (target == null) { + target = new EObjectWithInverseResolvingEList.ManyInverse<AbstractContent>(AbstractContent.class, this, + RBACorePackage.CONTENT_SET__TARGET, RBACorePackage.ABSTRACT_CONTENT__CONTENT_GROUP); + } + return target; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public EList<Content> collectLeafContents() { + java.util.Set<Content> contents = new java.util.LinkedHashSet<Content>(); + getTarget().forEach(content -> contents.addAll(content.collectLeafContents())); + return new org.eclipse.emf.common.util.BasicEList<Content>(contents); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RBACorePackage.CONTENT_SET__TARGET: + return ((InternalEList<InternalEObject>) (InternalEList<?>) getTarget()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RBACorePackage.CONTENT_SET__TARGET: + return ((InternalEList<?>) getTarget()).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 RBACorePackage.CONTENT_SET__TARGET: + return getTarget(); + } + 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 RBACorePackage.CONTENT_SET__TARGET: + getTarget().clear(); + getTarget().addAll((Collection<? extends AbstractContent>) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RBACorePackage.CONTENT_SET__TARGET: + getTarget().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBACorePackage.CONTENT_SET__TARGET: + return target != null && !target.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case RBACorePackage.CONTENT_SET___COLLECT_LEAF_CONTENTS: + return collectLeafContents(); + } + return super.eInvoke(operationID, arguments); + } + +} // ContentSetImpl |