/******************************************************************************* | |
* CHESS core plugin | |
* | |
* Copyright (C) 2011-2015 | |
* Mälardalen University, Sweden | |
* | |
* | |
* 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-v20.html | |
*******************************************************************************/ | |
package org.polarsys.chess.fla.flamm; | |
import java.util.Collection; | |
import java.util.List; | |
import org.eclipse.emf.common.notify.Notification; | |
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.EObject; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | |
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
/** | |
* <!-- begin-user-doc --> | |
* A representation of the model object '<em><b>Expression</b></em>'. | |
* <!-- end-user-doc --> | |
* | |
* <p> | |
* The following features are supported: | |
* </p> | |
* <ul> | |
* <li>{@link org.polarsys.chess.fla.flamm.Expression#getPort <em>Port</em>}</li> | |
* <li>{@link org.polarsys.chess.fla.flamm.Expression#getFailures <em>Failures</em>}</li> | |
* </ul> | |
* | |
* @see org.polarsys.chess.fla.flamm.FlammPackage#getExpression() | |
* @model kind="class" | |
* @generated | |
*/ | |
public class Expression extends MinimalEObjectImpl.Container implements EObject { | |
/** | |
* The cached value of the '{@link #getPort() <em>Port</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getPort() | |
* @generated | |
* @ordered | |
*/ | |
protected Port port; | |
/** | |
* The cached value of the '{@link #getFailures() <em>Failures</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFailures() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Failure> failures; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Expression() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return FlammPackage.Literals.EXPRESSION; | |
} | |
/** | |
* Returns the value of the '<em><b>Port</b></em>' reference. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of the '<em>Port</em>' reference isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @return the value of the '<em>Port</em>' reference. | |
* @see #setPort(Port) | |
* @see org.polarsys.chess.fla.flamm.FlammPackage#getExpression_Port() | |
* @model required="true" | |
* @generated | |
*/ | |
public Port getPort() { | |
if (port != null && port.eIsProxy()) { | |
InternalEObject oldPort = (InternalEObject)port; | |
port = (Port)eResolveProxy(oldPort); | |
if (port != oldPort) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FlammPackage.EXPRESSION__PORT, oldPort, port)); | |
} | |
} | |
return port; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Port basicGetPort() { | |
return port; | |
} | |
/** | |
* Sets the value of the '{@link org.polarsys.chess.fla.flamm.Expression#getPort <em>Port</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @param value the new value of the '<em>Port</em>' reference. | |
* @see #getPort() | |
* @generated | |
*/ | |
public void setPort(Port newPort) { | |
Port oldPort = port; | |
port = newPort; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, FlammPackage.EXPRESSION__PORT, oldPort, port)); | |
} | |
/** | |
* Returns the value of the '<em><b>Failures</b></em>' containment reference list. | |
* The list contents are of type {@link org.polarsys.chess.fla.flamm.Failure}. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of the '<em>Failures</em>' containment reference list isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @return the value of the '<em>Failures</em>' containment reference list. | |
* @see org.polarsys.chess.fla.flamm.FlammPackage#getExpression_Failures() | |
* @model containment="true" | |
* @generated | |
*/ | |
public List<Failure> getFailures() { | |
if (failures == null) { | |
failures = new EObjectContainmentEList<Failure>(Failure.class, this, FlammPackage.EXPRESSION__FAILURES); | |
} | |
return failures; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case FlammPackage.EXPRESSION__FAILURES: | |
return ((InternalEList<?>)getFailures()).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 FlammPackage.EXPRESSION__PORT: | |
if (resolve) return getPort(); | |
return basicGetPort(); | |
case FlammPackage.EXPRESSION__FAILURES: | |
return getFailures(); | |
} | |
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 FlammPackage.EXPRESSION__PORT: | |
setPort((Port)newValue); | |
return; | |
case FlammPackage.EXPRESSION__FAILURES: | |
getFailures().clear(); | |
getFailures().addAll((Collection<? extends Failure>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case FlammPackage.EXPRESSION__PORT: | |
setPort((Port)null); | |
return; | |
case FlammPackage.EXPRESSION__FAILURES: | |
getFailures().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case FlammPackage.EXPRESSION__PORT: | |
return port != null; | |
case FlammPackage.EXPRESSION__FAILURES: | |
return failures != null && !failures.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} // Expression |