| /** |
| * 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: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datamartdsl.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute; |
| |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartOrder; |
| import org.eclipse.osbp.xtext.datamartdsl.OrderEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Order</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartOrderImpl#getOrderBy <em>Order By</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartOrderImpl#getOrderHow <em>Order How</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartOrderImpl#isHasColumnWeight <em>Has Column Weight</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartOrderImpl#getColumnWeight <em>Column Weight</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartOrderImpl extends MinimalEObjectImpl.Container implements DatamartOrder { |
| /** |
| * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrderBy() |
| * @generated |
| * @ordered |
| */ |
| protected LEntityAttribute orderBy; |
| |
| /** |
| * The default value of the '{@link #getOrderHow() <em>Order How</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrderHow() |
| * @generated |
| * @ordered |
| */ |
| protected static final OrderEnum ORDER_HOW_EDEFAULT = OrderEnum.ASC; |
| |
| /** |
| * The cached value of the '{@link #getOrderHow() <em>Order How</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrderHow() |
| * @generated |
| * @ordered |
| */ |
| protected OrderEnum orderHow = ORDER_HOW_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isHasColumnWeight() <em>Has Column Weight</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isHasColumnWeight() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean HAS_COLUMN_WEIGHT_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isHasColumnWeight() <em>Has Column Weight</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isHasColumnWeight() |
| * @generated |
| * @ordered |
| */ |
| protected boolean hasColumnWeight = HAS_COLUMN_WEIGHT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getColumnWeight() <em>Column Weight</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumnWeight() |
| * @generated |
| * @ordered |
| */ |
| protected static final int COLUMN_WEIGHT_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getColumnWeight() <em>Column Weight</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumnWeight() |
| * @generated |
| * @ordered |
| */ |
| protected int columnWeight = COLUMN_WEIGHT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartOrderImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_ORDER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute getOrderBy() { |
| if (orderBy != null && orderBy.eIsProxy()) { |
| InternalEObject oldOrderBy = (InternalEObject)orderBy; |
| orderBy = (LEntityAttribute)eResolveProxy(oldOrderBy); |
| if (orderBy != oldOrderBy) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatamartDSLPackage.DATAMART_ORDER__ORDER_BY, oldOrderBy, orderBy)); |
| } |
| } |
| return orderBy; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute basicGetOrderBy() { |
| return orderBy; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOrderBy(LEntityAttribute newOrderBy) { |
| LEntityAttribute oldOrderBy = orderBy; |
| orderBy = newOrderBy; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ORDER__ORDER_BY, oldOrderBy, orderBy)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrderEnum getOrderHow() { |
| return orderHow; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOrderHow(OrderEnum newOrderHow) { |
| OrderEnum oldOrderHow = orderHow; |
| orderHow = newOrderHow == null ? ORDER_HOW_EDEFAULT : newOrderHow; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ORDER__ORDER_HOW, oldOrderHow, orderHow)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isHasColumnWeight() { |
| return hasColumnWeight; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHasColumnWeight(boolean newHasColumnWeight) { |
| boolean oldHasColumnWeight = hasColumnWeight; |
| hasColumnWeight = newHasColumnWeight; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ORDER__HAS_COLUMN_WEIGHT, oldHasColumnWeight, hasColumnWeight)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getColumnWeight() { |
| return columnWeight; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setColumnWeight(int newColumnWeight) { |
| int oldColumnWeight = columnWeight; |
| columnWeight = newColumnWeight; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ORDER__COLUMN_WEIGHT, oldColumnWeight, columnWeight)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_BY: |
| if (resolve) return getOrderBy(); |
| return basicGetOrderBy(); |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_HOW: |
| return getOrderHow(); |
| case DatamartDSLPackage.DATAMART_ORDER__HAS_COLUMN_WEIGHT: |
| return isHasColumnWeight(); |
| case DatamartDSLPackage.DATAMART_ORDER__COLUMN_WEIGHT: |
| return getColumnWeight(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_BY: |
| setOrderBy((LEntityAttribute)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_HOW: |
| setOrderHow((OrderEnum)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__HAS_COLUMN_WEIGHT: |
| setHasColumnWeight((Boolean)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__COLUMN_WEIGHT: |
| setColumnWeight((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_BY: |
| setOrderBy((LEntityAttribute)null); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_HOW: |
| setOrderHow(ORDER_HOW_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__HAS_COLUMN_WEIGHT: |
| setHasColumnWeight(HAS_COLUMN_WEIGHT_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_ORDER__COLUMN_WEIGHT: |
| setColumnWeight(COLUMN_WEIGHT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_BY: |
| return orderBy != null; |
| case DatamartDSLPackage.DATAMART_ORDER__ORDER_HOW: |
| return orderHow != ORDER_HOW_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_ORDER__HAS_COLUMN_WEIGHT: |
| return hasColumnWeight != HAS_COLUMN_WEIGHT_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_ORDER__COLUMN_WEIGHT: |
| return columnWeight != COLUMN_WEIGHT_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(" (orderHow: "); |
| result.append(orderHow); |
| result.append(", hasColumnWeight: "); |
| result.append(hasColumnWeight); |
| result.append(", columnWeight: "); |
| result.append(columnWeight); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DatamartOrderImpl |