1 7 package Olj.impl; 8 9 import Olj.OljPackage; 10 import Olj.SubCounterColumnType; 11 import Olj.SubCounterKeyColumnType; 12 import Olj.ValueModeType2; 13 14 import java.util.Collection ; 15 16 import org.eclipse.emf.common.notify.Notification; 17 import org.eclipse.emf.common.notify.NotificationChain; 18 19 import org.eclipse.emf.common.util.EList; 20 21 import org.eclipse.emf.ecore.EClass; 22 import org.eclipse.emf.ecore.EStructuralFeature; 23 import org.eclipse.emf.ecore.InternalEObject; 24 25 import org.eclipse.emf.ecore.impl.ENotificationImpl; 26 import org.eclipse.emf.ecore.impl.EObjectImpl; 27 28 import org.eclipse.emf.ecore.util.EObjectContainmentEList; 29 import org.eclipse.emf.ecore.util.InternalEList; 30 31 51 public class SubCounterColumnTypeImpl extends EObjectImpl implements SubCounterColumnType { 52 60 protected EList subCounterKeyColumn = null; 61 62 70 protected static final String COUNTER_INCREMENT_EDEFAULT = null; 71 72 80 protected String counterIncrement = COUNTER_INCREMENT_EDEFAULT; 81 82 90 protected static final String COUNTER_NAME_EDEFAULT = null; 91 92 100 protected String counterName = COUNTER_NAME_EDEFAULT; 101 102 110 protected static final String COUNTER_START_VALUE_EDEFAULT = null; 111 112 120 protected String counterStartValue = COUNTER_START_VALUE_EDEFAULT; 121 122 130 protected static final String TARGET_COLUMN_NAME_EDEFAULT = null; 131 132 140 protected String targetColumnName = TARGET_COLUMN_NAME_EDEFAULT; 141 142 150 protected static final String TARGET_TABLE_ID_EDEFAULT = null; 151 152 160 protected String targetTableID = TARGET_TABLE_ID_EDEFAULT; 161 162 170 protected static final String TARGET_TABLE_NAME_EDEFAULT = null; 171 172 180 protected String targetTableName = TARGET_TABLE_NAME_EDEFAULT; 181 182 190 protected static final ValueModeType2 VALUE_MODE_EDEFAULT = ValueModeType2.SET_IF_CREATED_LITERAL; 191 192 200 protected ValueModeType2 valueMode = VALUE_MODE_EDEFAULT; 201 202 209 protected boolean valueModeESet = false; 210 211 216 protected SubCounterColumnTypeImpl() { 217 super(); 218 } 219 220 225 protected EClass eStaticClass() { 226 return OljPackage.eINSTANCE.getSubCounterColumnType(); 227 } 228 229 234 public EList getSubCounterKeyColumn() { 235 if (subCounterKeyColumn == null) { 236 subCounterKeyColumn = new EObjectContainmentEList(SubCounterKeyColumnType.class, this, OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN); 237 } 238 return subCounterKeyColumn; 239 } 240 241 246 public String getCounterIncrement() { 247 return counterIncrement; 248 } 249 250 255 public void setCounterIncrement(String newCounterIncrement) { 256 String oldCounterIncrement = counterIncrement; 257 counterIncrement = newCounterIncrement; 258 if (eNotificationRequired()) 259 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT, oldCounterIncrement, counterIncrement)); 260 } 261 262 267 public String getCounterName() { 268 return counterName; 269 } 270 271 276 public void setCounterName(String newCounterName) { 277 String oldCounterName = counterName; 278 counterName = newCounterName; 279 if (eNotificationRequired()) 280 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME, oldCounterName, counterName)); 281 } 282 283 288 public String getCounterStartValue() { 289 return counterStartValue; 290 } 291 292 297 public void setCounterStartValue(String newCounterStartValue) { 298 String oldCounterStartValue = counterStartValue; 299 counterStartValue = newCounterStartValue; 300 if (eNotificationRequired()) 301 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE, oldCounterStartValue, counterStartValue)); 302 } 303 304 309 public String getTargetColumnName() { 310 return targetColumnName; 311 } 312 313 318 public void setTargetColumnName(String newTargetColumnName) { 319 String oldTargetColumnName = targetColumnName; 320 targetColumnName = newTargetColumnName; 321 if (eNotificationRequired()) 322 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME, oldTargetColumnName, targetColumnName)); 323 } 324 325 330 public String getTargetTableID() { 331 return targetTableID; 332 } 333 334 339 public void setTargetTableID(String newTargetTableID) { 340 String oldTargetTableID = targetTableID; 341 targetTableID = newTargetTableID; 342 if (eNotificationRequired()) 343 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID)); 344 } 345 346 351 public String getTargetTableName() { 352 return targetTableName; 353 } 354 355 360 public void setTargetTableName(String newTargetTableName) { 361 String oldTargetTableName = targetTableName; 362 targetTableName = newTargetTableName; 363 if (eNotificationRequired()) 364 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName)); 365 } 366 367 372 public ValueModeType2 getValueMode() { 373 return valueMode; 374 } 375 376 381 public void setValueMode(ValueModeType2 newValueMode) { 382 ValueModeType2 oldValueMode = valueMode; 383 valueMode = newValueMode == null ? VALUE_MODE_EDEFAULT : newValueMode; 384 boolean oldValueModeESet = valueModeESet; 385 valueModeESet = true; 386 if (eNotificationRequired()) 387 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet)); 388 } 389 390 395 public void unsetValueMode() { 396 ValueModeType2 oldValueMode = valueMode; 397 boolean oldValueModeESet = valueModeESet; 398 valueMode = VALUE_MODE_EDEFAULT; 399 valueModeESet = false; 400 if (eNotificationRequired()) 401 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet)); 402 } 403 404 409 public boolean isSetValueMode() { 410 return valueModeESet; 411 } 412 413 418 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 419 if (featureID >= 0) { 420 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 421 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN: 422 return ((InternalEList)getSubCounterKeyColumn()).basicRemove(otherEnd, msgs); 423 default: 424 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 425 } 426 } 427 return eBasicSetContainer(null, featureID, msgs); 428 } 429 430 435 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 436 switch (eDerivedStructuralFeatureID(eFeature)) { 437 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN: 438 return getSubCounterKeyColumn(); 439 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT: 440 return getCounterIncrement(); 441 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME: 442 return getCounterName(); 443 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE: 444 return getCounterStartValue(); 445 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME: 446 return getTargetColumnName(); 447 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID: 448 return getTargetTableID(); 449 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME: 450 return getTargetTableName(); 451 case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE: 452 return getValueMode(); 453 } 454 return eDynamicGet(eFeature, resolve); 455 } 456 457 462 public void eSet(EStructuralFeature eFeature, Object newValue) { 463 switch (eDerivedStructuralFeatureID(eFeature)) { 464 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN: 465 getSubCounterKeyColumn().clear(); 466 getSubCounterKeyColumn().addAll((Collection )newValue); 467 return; 468 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT: 469 setCounterIncrement((String )newValue); 470 return; 471 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME: 472 setCounterName((String )newValue); 473 return; 474 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE: 475 setCounterStartValue((String )newValue); 476 return; 477 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME: 478 setTargetColumnName((String )newValue); 479 return; 480 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID: 481 setTargetTableID((String )newValue); 482 return; 483 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME: 484 setTargetTableName((String )newValue); 485 return; 486 case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE: 487 setValueMode((ValueModeType2)newValue); 488 return; 489 } 490 eDynamicSet(eFeature, newValue); 491 } 492 493 498 public void eUnset(EStructuralFeature eFeature) { 499 switch (eDerivedStructuralFeatureID(eFeature)) { 500 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN: 501 getSubCounterKeyColumn().clear(); 502 return; 503 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT: 504 setCounterIncrement(COUNTER_INCREMENT_EDEFAULT); 505 return; 506 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME: 507 setCounterName(COUNTER_NAME_EDEFAULT); 508 return; 509 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE: 510 setCounterStartValue(COUNTER_START_VALUE_EDEFAULT); 511 return; 512 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME: 513 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT); 514 return; 515 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID: 516 setTargetTableID(TARGET_TABLE_ID_EDEFAULT); 517 return; 518 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME: 519 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT); 520 return; 521 case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE: 522 unsetValueMode(); 523 return; 524 } 525 eDynamicUnset(eFeature); 526 } 527 528 533 public boolean eIsSet(EStructuralFeature eFeature) { 534 switch (eDerivedStructuralFeatureID(eFeature)) { 535 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN: 536 return subCounterKeyColumn != null && !subCounterKeyColumn.isEmpty(); 537 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT: 538 return COUNTER_INCREMENT_EDEFAULT == null ? counterIncrement != null : !COUNTER_INCREMENT_EDEFAULT.equals(counterIncrement); 539 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME: 540 return COUNTER_NAME_EDEFAULT == null ? counterName != null : !COUNTER_NAME_EDEFAULT.equals(counterName); 541 case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE: 542 return COUNTER_START_VALUE_EDEFAULT == null ? counterStartValue != null : !COUNTER_START_VALUE_EDEFAULT.equals(counterStartValue); 543 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME: 544 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName); 545 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID: 546 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID); 547 case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME: 548 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName); 549 case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE: 550 return isSetValueMode(); 551 } 552 return eDynamicIsSet(eFeature); 553 } 554 555 560 public String toString() { 561 if (eIsProxy()) return super.toString(); 562 563 StringBuffer result = new StringBuffer (super.toString()); 564 result.append(" (counterIncrement: "); 565 result.append(counterIncrement); 566 result.append(", counterName: "); 567 result.append(counterName); 568 result.append(", counterStartValue: "); 569 result.append(counterStartValue); 570 result.append(", targetColumnName: "); 571 result.append(targetColumnName); 572 result.append(", targetTableID: "); 573 result.append(targetTableID); 574 result.append(", targetTableName: "); 575 result.append(targetTableName); 576 result.append(", valueMode: "); 577 if (valueModeESet) result.append(valueMode); else result.append("<unset>"); 578 result.append(')'); 579 return result.toString(); 580 } 581 582 } | Popular Tags |