blob: 9f6944bdad3e84c8a769034e0047a151f2cc4eac [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2019 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
/**
*/
package example3.kiamaas.impl;
import example3.kiamaas.KiamaasPackage;
import example3.kiamaas.Node;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Node</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link example3.kiamaas.impl.NodeImpl#getHeight <em>Height</em>}</li>
* <li>{@link example3.kiamaas.impl.NodeImpl#getDepth <em>Depth</em>}</li>
* </ul>
*
* @generated
*/
public abstract class NodeImpl extends MinimalEObjectImpl.Container implements Node {
/**
* The default value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected static final Integer HEIGHT_EDEFAULT = null;
/**
* The cached value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected Integer height = HEIGHT_EDEFAULT;
/**
* The default value of the '{@link #getDepth() <em>Depth</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDepth()
* @generated
* @ordered
*/
protected static final Integer DEPTH_EDEFAULT = null;
/**
* The cached value of the '{@link #getDepth() <em>Depth</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDepth()
* @generated
* @ordered
*/
protected Integer depth = DEPTH_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NodeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return KiamaasPackage.Literals.NODE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Integer getHeight() {
return height;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setHeight(Integer newHeight) {
Integer oldHeight = height;
height = newHeight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KiamaasPackage.NODE__HEIGHT, oldHeight, height));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Integer getDepth() {
return depth;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setDepth(Integer newDepth) {
Integer oldDepth = depth;
depth = newDepth;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KiamaasPackage.NODE__DEPTH, oldDepth, depth));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case KiamaasPackage.NODE__HEIGHT:
return getHeight();
case KiamaasPackage.NODE__DEPTH:
return getDepth();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case KiamaasPackage.NODE__HEIGHT:
setHeight((Integer)newValue);
return;
case KiamaasPackage.NODE__DEPTH:
setDepth((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case KiamaasPackage.NODE__HEIGHT:
setHeight(HEIGHT_EDEFAULT);
return;
case KiamaasPackage.NODE__DEPTH:
setDepth(DEPTH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case KiamaasPackage.NODE__HEIGHT:
return HEIGHT_EDEFAULT == null ? height != null : !HEIGHT_EDEFAULT.equals(height);
case KiamaasPackage.NODE__DEPTH:
return DEPTH_EDEFAULT == null ? depth != null : !DEPTH_EDEFAULT.equals(depth);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (height: ");
result.append(height);
result.append(", depth: ");
result.append(depth);
result.append(')');
return result.toString();
}
} //NodeImpl