blob: 0424149e7544221d42561f4c5cca886b871ef267 [file] [log] [blame]
/******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
****************************************************************************/
package org.eclipse.gmf.examples.runtime.diagram.logic.model.impl;
import org.eclipse.gmf.examples.runtime.diagram.logic.model.Circuit;
import org.eclipse.gmf.examples.runtime.diagram.logic.model.SemanticPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Circuit</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class CircuitImpl extends ContainerElementImpl implements Circuit {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CircuitImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return SemanticPackage.eINSTANCE.getCircuit();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
if (featureID >= 0) {
switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
case SemanticPackage.CIRCUIT__TERMINALS:
return ((InternalEList)getTerminals()).basicRemove(otherEnd, msgs);
case SemanticPackage.CIRCUIT__CHILDREN:
return ((InternalEList)getChildren()).basicRemove(otherEnd, msgs);
default:
return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
}
}
return eBasicSetContainer(null, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(EStructuralFeature eFeature, boolean resolve) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case SemanticPackage.CIRCUIT__TERMINALS:
return getTerminals();
case SemanticPackage.CIRCUIT__OUTPUT_TERMINALS:
return getOutputTerminals();
case SemanticPackage.CIRCUIT__INPUT_TERMINALS:
return getInputTerminals();
case SemanticPackage.CIRCUIT__CHILDREN:
return getChildren();
}
return eDynamicGet(eFeature, resolve);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(EStructuralFeature eFeature, Object newValue) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case SemanticPackage.CIRCUIT__TERMINALS:
getTerminals().clear();
getTerminals().addAll((Collection)newValue);
return;
case SemanticPackage.CIRCUIT__CHILDREN:
getChildren().clear();
getChildren().addAll((Collection)newValue);
return;
}
eDynamicSet(eFeature, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case SemanticPackage.CIRCUIT__TERMINALS:
getTerminals().clear();
return;
case SemanticPackage.CIRCUIT__CHILDREN:
getChildren().clear();
return;
}
eDynamicUnset(eFeature);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case SemanticPackage.CIRCUIT__TERMINALS:
return terminals != null && !terminals.isEmpty();
case SemanticPackage.CIRCUIT__OUTPUT_TERMINALS:
return !getOutputTerminals().isEmpty();
case SemanticPackage.CIRCUIT__INPUT_TERMINALS:
return !getInputTerminals().isEmpty();
case SemanticPackage.CIRCUIT__CHILDREN:
return children != null && !children.isEmpty();
}
return eDynamicIsSet(eFeature);
}
} //CircuitImpl