| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.entitymock.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage; |
| import org.eclipse.osbp.xtext.entitymock.PropertyFillerDateRange; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Property Filler Date Range</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.PropertyFillerDateRangeImpl#getDateBeginYears <em>Date Begin Years</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.PropertyFillerDateRangeImpl#getDateEndYears <em>Date End Years</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PropertyFillerDateRangeImpl extends PropertyFillerDateTypeImpl implements PropertyFillerDateRange { |
| /** |
| * The default value of the '{@link #getDateBeginYears() <em>Date Begin Years</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDateBeginYears() |
| * @generated |
| * @ordered |
| */ |
| protected static final int DATE_BEGIN_YEARS_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getDateBeginYears() <em>Date Begin Years</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDateBeginYears() |
| * @generated |
| * @ordered |
| */ |
| protected int dateBeginYears = DATE_BEGIN_YEARS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDateEndYears() <em>Date End Years</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDateEndYears() |
| * @generated |
| * @ordered |
| */ |
| protected static final int DATE_END_YEARS_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getDateEndYears() <em>Date End Years</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDateEndYears() |
| * @generated |
| * @ordered |
| */ |
| protected int dateEndYears = DATE_END_YEARS_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PropertyFillerDateRangeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EntityMockDSLPackage.Literals.PROPERTY_FILLER_DATE_RANGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getDateBeginYears() { |
| return dateBeginYears; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDateBeginYears(int newDateBeginYears) { |
| int oldDateBeginYears = dateBeginYears; |
| dateBeginYears = newDateBeginYears; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_BEGIN_YEARS, oldDateBeginYears, dateBeginYears)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getDateEndYears() { |
| return dateEndYears; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDateEndYears(int newDateEndYears) { |
| int oldDateEndYears = dateEndYears; |
| dateEndYears = newDateEndYears; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_END_YEARS, oldDateEndYears, dateEndYears)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_BEGIN_YEARS: |
| return getDateBeginYears(); |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_END_YEARS: |
| return getDateEndYears(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_BEGIN_YEARS: |
| setDateBeginYears((Integer)newValue); |
| return; |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_END_YEARS: |
| setDateEndYears((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_BEGIN_YEARS: |
| setDateBeginYears(DATE_BEGIN_YEARS_EDEFAULT); |
| return; |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_END_YEARS: |
| setDateEndYears(DATE_END_YEARS_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_BEGIN_YEARS: |
| return dateBeginYears != DATE_BEGIN_YEARS_EDEFAULT; |
| case EntityMockDSLPackage.PROPERTY_FILLER_DATE_RANGE__DATE_END_YEARS: |
| return dateEndYears != DATE_END_YEARS_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (dateBeginYears: "); |
| result.append(dateBeginYears); |
| result.append(", dateEndYears: "); |
| result.append(dateEndYears); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PropertyFillerDateRangeImpl |