diff options
author | 2021-08-03 18:42:39 +0900 | |
---|---|---|
committer | 2021-08-06 19:32:38 +0900 | |
commit | be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 (patch) | |
tree | 1f3f1a96251ac4f655c8a96fc33d5d4ee779cd06 /rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java | |
parent | 71ca7c6cab863767ef30c8bd05b2bbfda8731cb5 (diff) |
Initial commit
Bug-AGL: SPEC-4033
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java')
-rw-r--r-- | rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java | 192 |
1 files changed, 192 insertions, 0 deletions
diff --git a/rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java b/rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java new file mode 100644 index 0000000..1e5234e --- /dev/null +++ b/rba.model.core/src/rba/core/impl/LoserTypeExpressionImpl.java @@ -0,0 +1,192 @@ +/** + */ +package rba.core.impl; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.Enumerator; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import rba.core.LoserType; +import rba.core.LoserTypeExpression; +import rba.core.RBACorePackage; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Loser Type Expression</b></em>'. <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link rba.core.impl.LoserTypeExpressionImpl#getValue <em>Value</em>}</li> + * </ul> + * + * @generated + */ +public class LoserTypeExpressionImpl extends EnumExpressionImpl implements LoserTypeExpression { + /** + * The default value of the '{@link #getValue() <em>Value</em>}' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @see #getValue() + * @generated + * @ordered + */ + protected static final LoserType VALUE_EDEFAULT = LoserType.NEVER_GIVEUP; + + /** + * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @see #getValue() + * @generated + * @ordered + */ + protected LoserType value = VALUE_EDEFAULT; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected LoserTypeExpressionImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBACorePackage.Literals.LOSER_TYPE_EXPRESSION; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public LoserType getValue() { + return value; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public void setValue(LoserType newValue) { + LoserType oldValue = value; + value = newValue == null ? VALUE_EDEFAULT : newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.LOSER_TYPE_EXPRESSION__VALUE, oldValue, + value)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public String getExpressionText() { + if (value instanceof LoserType) { + return value.getName(); + } else { + return "[Invalid_Expression]"; + } + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public Enumerator getExpressionValue() { + return value; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RBACorePackage.LOSER_TYPE_EXPRESSION__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RBACorePackage.LOSER_TYPE_EXPRESSION__VALUE: + setValue((LoserType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RBACorePackage.LOSER_TYPE_EXPRESSION__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBACorePackage.LOSER_TYPE_EXPRESSION__VALUE: + return value != VALUE_EDEFAULT; + } + 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.LOSER_TYPE_EXPRESSION___GET_EXPRESSION_TEXT: + return getExpressionText(); + case RBACorePackage.LOSER_TYPE_EXPRESSION___GET_EXPRESSION_VALUE: + return getExpressionValue(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} // LoserTypeExpressionImpl |