/** | |
* Copyright (c) 2020 CEA LIST. | |
* | |
* 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\n\nContributors: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.infrastructure.impl; | |
import org.eclipse.efm.ecore.formalml.infrastructure.InfrastructurePackage; | |
import org.eclipse.efm.ecore.formalml.infrastructure.Modifier; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Modifier</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isStatic <em>Static</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isFinal <em>Final</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isReference <em>Reference</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isVolatile <em>Volatile</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isTransient <em>Transient</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModifierImpl#isOptional <em>Optional</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class ModifierImpl extends MinimalEObjectImpl.Container implements Modifier { | |
/** | |
* The default value of the '{@link #isStatic() <em>Static</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isStatic() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean STATIC_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isStatic() <em>Static</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isStatic() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean static_ = STATIC_EDEFAULT; | |
/** | |
* The default value of the '{@link #isFinal() <em>Final</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isFinal() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean FINAL_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isFinal() <em>Final</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isFinal() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean final_ = FINAL_EDEFAULT; | |
/** | |
* The default value of the '{@link #isReference() <em>Reference</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isReference() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean REFERENCE_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isReference() <em>Reference</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isReference() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean reference = REFERENCE_EDEFAULT; | |
/** | |
* The default value of the '{@link #isVolatile() <em>Volatile</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isVolatile() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean VOLATILE_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isVolatile() <em>Volatile</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isVolatile() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean volatile_ = VOLATILE_EDEFAULT; | |
/** | |
* The default value of the '{@link #isTransient() <em>Transient</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isTransient() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean TRANSIENT_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isTransient() <em>Transient</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isTransient() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean transient_ = TRANSIENT_EDEFAULT; | |
/** | |
* The default value of the '{@link #isOptional() <em>Optional</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isOptional() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean OPTIONAL_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isOptional() <em>Optional</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isOptional() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean optional = OPTIONAL_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ModifierImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return InfrastructurePackage.Literals.MODIFIER; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isStatic() { | |
return static_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setStatic(boolean newStatic) { | |
boolean oldStatic = static_; | |
static_ = newStatic; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__STATIC, oldStatic, static_)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isFinal() { | |
return final_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setFinal(boolean newFinal) { | |
boolean oldFinal = final_; | |
final_ = newFinal; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__FINAL, oldFinal, final_)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isReference() { | |
return reference; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setReference(boolean newReference) { | |
boolean oldReference = reference; | |
reference = newReference; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__REFERENCE, oldReference, reference)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isVolatile() { | |
return volatile_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setVolatile(boolean newVolatile) { | |
boolean oldVolatile = volatile_; | |
volatile_ = newVolatile; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__VOLATILE, oldVolatile, volatile_)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isTransient() { | |
return transient_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setTransient(boolean newTransient) { | |
boolean oldTransient = transient_; | |
transient_ = newTransient; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__TRANSIENT, oldTransient, transient_)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean isOptional() { | |
return optional; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setOptional(boolean newOptional) { | |
boolean oldOptional = optional; | |
optional = newOptional; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, InfrastructurePackage.MODIFIER__OPTIONAL, oldOptional, optional)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case InfrastructurePackage.MODIFIER__STATIC: | |
return isStatic(); | |
case InfrastructurePackage.MODIFIER__FINAL: | |
return isFinal(); | |
case InfrastructurePackage.MODIFIER__REFERENCE: | |
return isReference(); | |
case InfrastructurePackage.MODIFIER__VOLATILE: | |
return isVolatile(); | |
case InfrastructurePackage.MODIFIER__TRANSIENT: | |
return isTransient(); | |
case InfrastructurePackage.MODIFIER__OPTIONAL: | |
return isOptional(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case InfrastructurePackage.MODIFIER__STATIC: | |
setStatic((Boolean)newValue); | |
return; | |
case InfrastructurePackage.MODIFIER__FINAL: | |
setFinal((Boolean)newValue); | |
return; | |
case InfrastructurePackage.MODIFIER__REFERENCE: | |
setReference((Boolean)newValue); | |
return; | |
case InfrastructurePackage.MODIFIER__VOLATILE: | |
setVolatile((Boolean)newValue); | |
return; | |
case InfrastructurePackage.MODIFIER__TRANSIENT: | |
setTransient((Boolean)newValue); | |
return; | |
case InfrastructurePackage.MODIFIER__OPTIONAL: | |
setOptional((Boolean)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case InfrastructurePackage.MODIFIER__STATIC: | |
setStatic(STATIC_EDEFAULT); | |
return; | |
case InfrastructurePackage.MODIFIER__FINAL: | |
setFinal(FINAL_EDEFAULT); | |
return; | |
case InfrastructurePackage.MODIFIER__REFERENCE: | |
setReference(REFERENCE_EDEFAULT); | |
return; | |
case InfrastructurePackage.MODIFIER__VOLATILE: | |
setVolatile(VOLATILE_EDEFAULT); | |
return; | |
case InfrastructurePackage.MODIFIER__TRANSIENT: | |
setTransient(TRANSIENT_EDEFAULT); | |
return; | |
case InfrastructurePackage.MODIFIER__OPTIONAL: | |
setOptional(OPTIONAL_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case InfrastructurePackage.MODIFIER__STATIC: | |
return static_ != STATIC_EDEFAULT; | |
case InfrastructurePackage.MODIFIER__FINAL: | |
return final_ != FINAL_EDEFAULT; | |
case InfrastructurePackage.MODIFIER__REFERENCE: | |
return reference != REFERENCE_EDEFAULT; | |
case InfrastructurePackage.MODIFIER__VOLATILE: | |
return volatile_ != VOLATILE_EDEFAULT; | |
case InfrastructurePackage.MODIFIER__TRANSIENT: | |
return transient_ != TRANSIENT_EDEFAULT; | |
case InfrastructurePackage.MODIFIER__OPTIONAL: | |
return optional != OPTIONAL_EDEFAULT; | |
} | |
return super.eIsSet(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public String toString() { | |
if (eIsProxy()) return super.toString(); | |
StringBuilder result = new StringBuilder(super.toString()); | |
result.append(" (static: "); | |
result.append(static_); | |
result.append(", final: "); | |
result.append(final_); | |
result.append(", reference: "); | |
result.append(reference); | |
result.append(", volatile: "); | |
result.append(volatile_); | |
result.append(", transient: "); | |
result.append(transient_); | |
result.append(", optional: "); | |
result.append(optional); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //ModifierImpl |