blob: 731921b30d0a7f72224fcd0253c010f612356c5f [file] [log] [blame]
/**
* 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.reportdsl.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.reportdsl.BinaryAggregationTypeEnum;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
import org.eclipse.osbp.xtext.reportdsl.TableBinaryAggregation;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Table Binary Aggregation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.TableBinaryAggregationImpl#getAggregation <em>Aggregation</em>}</li>
* </ul>
*
* @generated
*/
public class TableBinaryAggregationImpl extends TableBaseAggregationImpl implements TableBinaryAggregation {
/**
* The default value of the '{@link #getAggregation() <em>Aggregation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAggregation()
* @generated
* @ordered
*/
protected static final BinaryAggregationTypeEnum AGGREGATION_EDEFAULT = BinaryAggregationTypeEnum.DIV;
/**
* The cached value of the '{@link #getAggregation() <em>Aggregation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAggregation()
* @generated
* @ordered
*/
protected BinaryAggregationTypeEnum aggregation = AGGREGATION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TableBinaryAggregationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.TABLE_BINARY_AGGREGATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BinaryAggregationTypeEnum getAggregation() {
return aggregation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAggregation(BinaryAggregationTypeEnum newAggregation) {
BinaryAggregationTypeEnum oldAggregation = aggregation;
aggregation = newAggregation == null ? AGGREGATION_EDEFAULT : newAggregation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.TABLE_BINARY_AGGREGATION__AGGREGATION, oldAggregation, aggregation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.TABLE_BINARY_AGGREGATION__AGGREGATION:
return getAggregation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReportDSLPackage.TABLE_BINARY_AGGREGATION__AGGREGATION:
setAggregation((BinaryAggregationTypeEnum)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.TABLE_BINARY_AGGREGATION__AGGREGATION:
setAggregation(AGGREGATION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.TABLE_BINARY_AGGREGATION__AGGREGATION:
return aggregation != AGGREGATION_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(" (aggregation: ");
result.append(aggregation);
result.append(')');
return result.toString();
}
} //TableBinaryAggregationImpl