blob: 2a1af160548541415f8ac2d47c47e5bbd7261253 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: CustomCategoryImpl.java,v 1.3 2006/09/07 00:05:59 klow Exp $
*/
package org.eclipse.epf.xml.uma.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.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.epf.xml.uma.CustomCategory;
import org.eclipse.epf.xml.uma.UmaPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Custom Category</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.epf.xml.uma.impl.CustomCategoryImpl#getGroup2 <em>Group2</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.CustomCategoryImpl#getCategorizedElement <em>Categorized Element</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.CustomCategoryImpl#getSubCategory <em>Sub Category</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CustomCategoryImpl extends ContentCategoryImpl implements CustomCategory {
/**
* The cached value of the '{@link #getGroup2() <em>Group2</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGroup2()
* @generated
* @ordered
*/
protected FeatureMap group2 = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CustomCategoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return UmaPackage.Literals.CUSTOM_CATEGORY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getGroup2() {
if (group2 == null) {
group2 = new BasicFeatureMap(this, UmaPackage.CUSTOM_CATEGORY__GROUP2);
}
return group2;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getCategorizedElement() {
return ((FeatureMap)getGroup2()).list(UmaPackage.Literals.CUSTOM_CATEGORY__CATEGORIZED_ELEMENT);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getSubCategory() {
return ((FeatureMap)getGroup2()).list(UmaPackage.Literals.CUSTOM_CATEGORY__SUB_CATEGORY);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case UmaPackage.CUSTOM_CATEGORY__GROUP2:
return ((InternalEList)getGroup2()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UmaPackage.CUSTOM_CATEGORY__GROUP2:
if (coreType) return getGroup2();
return ((FeatureMap.Internal)getGroup2()).getWrapper();
case UmaPackage.CUSTOM_CATEGORY__CATEGORIZED_ELEMENT:
return getCategorizedElement();
case UmaPackage.CUSTOM_CATEGORY__SUB_CATEGORY:
return getSubCategory();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UmaPackage.CUSTOM_CATEGORY__GROUP2:
((FeatureMap.Internal)getGroup2()).set(newValue);
return;
case UmaPackage.CUSTOM_CATEGORY__CATEGORIZED_ELEMENT:
getCategorizedElement().clear();
getCategorizedElement().addAll((Collection)newValue);
return;
case UmaPackage.CUSTOM_CATEGORY__SUB_CATEGORY:
getSubCategory().clear();
getSubCategory().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case UmaPackage.CUSTOM_CATEGORY__GROUP2:
getGroup2().clear();
return;
case UmaPackage.CUSTOM_CATEGORY__CATEGORIZED_ELEMENT:
getCategorizedElement().clear();
return;
case UmaPackage.CUSTOM_CATEGORY__SUB_CATEGORY:
getSubCategory().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case UmaPackage.CUSTOM_CATEGORY__GROUP2:
return group2 != null && !group2.isEmpty();
case UmaPackage.CUSTOM_CATEGORY__CATEGORIZED_ELEMENT:
return !getCategorizedElement().isEmpty();
case UmaPackage.CUSTOM_CATEGORY__SUB_CATEGORY:
return !getSubCategory().isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (group2: ");
result.append(group2);
result.append(')');
return result.toString();
}
} //CustomCategoryImpl