blob: 25ae6186d0f5b18b73b6761ed41f6b07c986fd49 [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.datamartdsl.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.osbp.xtext.cubedsl.CubeType;
import org.eclipse.osbp.xtext.datamartdsl.DatamartCube;
import org.eclipse.osbp.xtext.datamartdsl.DatamartCubeElement;
import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Datamart Cube</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartCubeImpl#isNonEmpty <em>Non Empty</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartCubeImpl#getCubeRef <em>Cube Ref</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartCubeImpl#getAxisslicer <em>Axisslicer</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DatamartCubeImpl extends DatamartLazyResolverImpl implements DatamartCube {
/**
* The default value of the '{@link #isNonEmpty() <em>Non Empty</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isNonEmpty()
* @generated
* @ordered
*/
protected static final boolean NON_EMPTY_EDEFAULT = false;
/**
* The cached value of the '{@link #isNonEmpty() <em>Non Empty</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isNonEmpty()
* @generated
* @ordered
*/
protected boolean nonEmpty = NON_EMPTY_EDEFAULT;
/**
* The cached value of the '{@link #getCubeRef() <em>Cube Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCubeRef()
* @generated
* @ordered
*/
protected CubeType cubeRef;
/**
* The cached value of the '{@link #getAxisslicer() <em>Axisslicer</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAxisslicer()
* @generated
* @ordered
*/
protected EList<DatamartCubeElement> axisslicer;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DatamartCubeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DatamartDSLPackage.Literals.DATAMART_CUBE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isNonEmpty() {
return nonEmpty;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNonEmpty(boolean newNonEmpty) {
boolean oldNonEmpty = nonEmpty;
nonEmpty = newNonEmpty;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_CUBE__NON_EMPTY, oldNonEmpty, nonEmpty));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CubeType getCubeRef() {
if (cubeRef != null && cubeRef.eIsProxy()) {
InternalEObject oldCubeRef = (InternalEObject)cubeRef;
cubeRef = (CubeType)eResolveProxy(oldCubeRef);
if (cubeRef != oldCubeRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatamartDSLPackage.DATAMART_CUBE__CUBE_REF, oldCubeRef, cubeRef));
}
}
return cubeRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CubeType basicGetCubeRef() {
return cubeRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCubeRef(CubeType newCubeRef) {
CubeType oldCubeRef = cubeRef;
cubeRef = newCubeRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_CUBE__CUBE_REF, oldCubeRef, cubeRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DatamartCubeElement> getAxisslicer() {
if (axisslicer == null) {
axisslicer = new EObjectContainmentEList<DatamartCubeElement>(DatamartCubeElement.class, this, DatamartDSLPackage.DATAMART_CUBE__AXISSLICER);
}
return axisslicer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_CUBE__AXISSLICER:
return ((InternalEList<?>)getAxisslicer()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_CUBE__NON_EMPTY:
return isNonEmpty();
case DatamartDSLPackage.DATAMART_CUBE__CUBE_REF:
if (resolve) return getCubeRef();
return basicGetCubeRef();
case DatamartDSLPackage.DATAMART_CUBE__AXISSLICER:
return getAxisslicer();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_CUBE__NON_EMPTY:
setNonEmpty((Boolean)newValue);
return;
case DatamartDSLPackage.DATAMART_CUBE__CUBE_REF:
setCubeRef((CubeType)newValue);
return;
case DatamartDSLPackage.DATAMART_CUBE__AXISSLICER:
getAxisslicer().clear();
getAxisslicer().addAll((Collection<? extends DatamartCubeElement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_CUBE__NON_EMPTY:
setNonEmpty(NON_EMPTY_EDEFAULT);
return;
case DatamartDSLPackage.DATAMART_CUBE__CUBE_REF:
setCubeRef((CubeType)null);
return;
case DatamartDSLPackage.DATAMART_CUBE__AXISSLICER:
getAxisslicer().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_CUBE__NON_EMPTY:
return nonEmpty != NON_EMPTY_EDEFAULT;
case DatamartDSLPackage.DATAMART_CUBE__CUBE_REF:
return cubeRef != null;
case DatamartDSLPackage.DATAMART_CUBE__AXISSLICER:
return axisslicer != null && !axisslicer.isEmpty();
}
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(" (nonEmpty: ");
result.append(nonEmpty);
result.append(')');
return result.toString();
}
} //DatamartCubeImpl