blob: aa3a4f07186a11134f52958537999e7fdfbb4e9c [file] [log] [blame]
/**
* Copyright (c) 2000-2009, Intalio Inc.
* 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:
* Intalio Inc. - initial API and implementation
*
*/
package org.eclipse.mdt.bpmn.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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.mdt.bpmn.BpmnPackage;
import org.eclipse.mdt.bpmn.Category;
import org.eclipse.mdt.bpmn.CategoryValue;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Category</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mdt.bpmn.impl.CategoryImpl#getCategoryValue <em>Category Value</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CategoryImpl extends RootElementImpl implements Category {
/**
* The cached value of the '{@link #getCategoryValue() <em>Category Value</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCategoryValue()
* @generated
* @ordered
*/
protected EList<CategoryValue> categoryValue;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CategoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpmnPackage.eINSTANCE.getCategory();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<CategoryValue> getCategoryValue() {
if (categoryValue == null) {
categoryValue = new EObjectContainmentEList<CategoryValue>(
CategoryValue.class, this,
BpmnPackage.CATEGORY__CATEGORY_VALUE);
}
return categoryValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case BpmnPackage.CATEGORY__CATEGORY_VALUE:
return ((InternalEList<?>) getCategoryValue()).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 BpmnPackage.CATEGORY__CATEGORY_VALUE:
return getCategoryValue();
}
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 BpmnPackage.CATEGORY__CATEGORY_VALUE:
getCategoryValue().clear();
getCategoryValue().addAll(
(Collection<? extends CategoryValue>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpmnPackage.CATEGORY__CATEGORY_VALUE:
getCategoryValue().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpmnPackage.CATEGORY__CATEGORY_VALUE:
return categoryValue != null && !categoryValue.isEmpty();
}
return super.eIsSet(featureID);
}
} //CategoryImpl