[100] | 1 | /** |
---|
| 2 | */ |
---|
| 3 | package de.ugoe.cs.swe.bnftools.ebnf.impl; |
---|
| 4 | |
---|
| 5 | import de.ugoe.cs.swe.bnftools.ebnf.Comment; |
---|
| 6 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage; |
---|
| 7 | |
---|
| 8 | import org.eclipse.emf.common.notify.Notification; |
---|
| 9 | |
---|
| 10 | import org.eclipse.emf.ecore.EClass; |
---|
| 11 | |
---|
| 12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
---|
| 13 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
---|
| 14 | |
---|
| 15 | /** |
---|
| 16 | * <!-- begin-user-doc --> |
---|
| 17 | * An implementation of the model object '<em><b>Comment</b></em>'. |
---|
| 18 | * <!-- end-user-doc --> |
---|
| 19 | * <p> |
---|
| 20 | * The following features are implemented: |
---|
| 21 | * <ul> |
---|
| 22 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.CommentImpl#getContent <em>Content</em>}</li> |
---|
| 23 | * </ul> |
---|
| 24 | * </p> |
---|
| 25 | * |
---|
| 26 | * @generated |
---|
| 27 | */ |
---|
| 28 | public class CommentImpl extends MinimalEObjectImpl.Container implements Comment |
---|
| 29 | { |
---|
| 30 | /** |
---|
| 31 | * The default value of the '{@link #getContent() <em>Content</em>}' attribute. |
---|
| 32 | * <!-- begin-user-doc --> |
---|
| 33 | * <!-- end-user-doc --> |
---|
| 34 | * @see #getContent() |
---|
| 35 | * @generated |
---|
| 36 | * @ordered |
---|
| 37 | */ |
---|
| 38 | protected static final String CONTENT_EDEFAULT = null; |
---|
| 39 | |
---|
| 40 | /** |
---|
| 41 | * The cached value of the '{@link #getContent() <em>Content</em>}' attribute. |
---|
| 42 | * <!-- begin-user-doc --> |
---|
| 43 | * <!-- end-user-doc --> |
---|
| 44 | * @see #getContent() |
---|
| 45 | * @generated |
---|
| 46 | * @ordered |
---|
| 47 | */ |
---|
| 48 | protected String content = CONTENT_EDEFAULT; |
---|
| 49 | |
---|
| 50 | /** |
---|
| 51 | * <!-- begin-user-doc --> |
---|
| 52 | * <!-- end-user-doc --> |
---|
| 53 | * @generated |
---|
| 54 | */ |
---|
| 55 | protected CommentImpl() |
---|
| 56 | { |
---|
| 57 | super(); |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | /** |
---|
| 61 | * <!-- begin-user-doc --> |
---|
| 62 | * <!-- end-user-doc --> |
---|
| 63 | * @generated |
---|
| 64 | */ |
---|
| 65 | @Override |
---|
| 66 | protected EClass eStaticClass() |
---|
| 67 | { |
---|
| 68 | return EbnfPackage.Literals.COMMENT; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | /** |
---|
| 72 | * <!-- begin-user-doc --> |
---|
| 73 | * <!-- end-user-doc --> |
---|
| 74 | * @generated |
---|
| 75 | */ |
---|
| 76 | public String getContent() |
---|
| 77 | { |
---|
| 78 | return content; |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | /** |
---|
| 82 | * <!-- begin-user-doc --> |
---|
| 83 | * <!-- end-user-doc --> |
---|
| 84 | * @generated |
---|
| 85 | */ |
---|
| 86 | public void setContent(String newContent) |
---|
| 87 | { |
---|
| 88 | String oldContent = content; |
---|
| 89 | content = newContent; |
---|
| 90 | if (eNotificationRequired()) |
---|
| 91 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.COMMENT__CONTENT, oldContent, content)); |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | /** |
---|
| 95 | * <!-- begin-user-doc --> |
---|
| 96 | * <!-- end-user-doc --> |
---|
| 97 | * @generated |
---|
| 98 | */ |
---|
| 99 | @Override |
---|
| 100 | public Object eGet(int featureID, boolean resolve, boolean coreType) |
---|
| 101 | { |
---|
| 102 | switch (featureID) |
---|
| 103 | { |
---|
| 104 | case EbnfPackage.COMMENT__CONTENT: |
---|
| 105 | return getContent(); |
---|
| 106 | } |
---|
| 107 | return super.eGet(featureID, resolve, coreType); |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | /** |
---|
| 111 | * <!-- begin-user-doc --> |
---|
| 112 | * <!-- end-user-doc --> |
---|
| 113 | * @generated |
---|
| 114 | */ |
---|
| 115 | @Override |
---|
| 116 | public void eSet(int featureID, Object newValue) |
---|
| 117 | { |
---|
| 118 | switch (featureID) |
---|
| 119 | { |
---|
| 120 | case EbnfPackage.COMMENT__CONTENT: |
---|
| 121 | setContent((String)newValue); |
---|
| 122 | return; |
---|
| 123 | } |
---|
| 124 | super.eSet(featureID, newValue); |
---|
| 125 | } |
---|
| 126 | |
---|
| 127 | /** |
---|
| 128 | * <!-- begin-user-doc --> |
---|
| 129 | * <!-- end-user-doc --> |
---|
| 130 | * @generated |
---|
| 131 | */ |
---|
| 132 | @Override |
---|
| 133 | public void eUnset(int featureID) |
---|
| 134 | { |
---|
| 135 | switch (featureID) |
---|
| 136 | { |
---|
| 137 | case EbnfPackage.COMMENT__CONTENT: |
---|
| 138 | setContent(CONTENT_EDEFAULT); |
---|
| 139 | return; |
---|
| 140 | } |
---|
| 141 | super.eUnset(featureID); |
---|
| 142 | } |
---|
| 143 | |
---|
| 144 | /** |
---|
| 145 | * <!-- begin-user-doc --> |
---|
| 146 | * <!-- end-user-doc --> |
---|
| 147 | * @generated |
---|
| 148 | */ |
---|
| 149 | @Override |
---|
| 150 | public boolean eIsSet(int featureID) |
---|
| 151 | { |
---|
| 152 | switch (featureID) |
---|
| 153 | { |
---|
| 154 | case EbnfPackage.COMMENT__CONTENT: |
---|
| 155 | return CONTENT_EDEFAULT == null ? content != null : !CONTENT_EDEFAULT.equals(content); |
---|
| 156 | } |
---|
| 157 | return super.eIsSet(featureID); |
---|
| 158 | } |
---|
| 159 | |
---|
| 160 | /** |
---|
| 161 | * <!-- begin-user-doc --> |
---|
| 162 | * <!-- end-user-doc --> |
---|
| 163 | * @generated |
---|
| 164 | */ |
---|
| 165 | @Override |
---|
| 166 | public String toString() |
---|
| 167 | { |
---|
| 168 | if (eIsProxy()) return super.toString(); |
---|
| 169 | |
---|
| 170 | StringBuffer result = new StringBuffer(super.toString()); |
---|
| 171 | result.append(" (content: "); |
---|
| 172 | result.append(content); |
---|
| 173 | result.append(')'); |
---|
| 174 | return result.toString(); |
---|
| 175 | } |
---|
| 176 | |
---|
| 177 | } //CommentImpl |
---|