blob: efddbd144873449d8ea4047d33a4938f37ca20f6 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2017 Timing-Architects Embedded Systems GmbH and others.
* 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
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.generator.configuration.impl;
import org.eclipse.app4mc.amalthea.generator.configuration.RTMGCPackage;
import org.eclipse.app4mc.amalthea.generator.configuration.Recurrence;
import org.eclipse.app4mc.amalthea.generator.configuration.RecurrenceType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Recurrence</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.generator.configuration.impl.RecurrenceImpl#getRecurrenceType <em>Recurrence Type</em>}</li>
* </ul>
*
* @generated
*/
public class RecurrenceImpl extends IntegerTimeDistributionImpl implements Recurrence {
/**
* The default value of the '{@link #getRecurrenceType() <em>Recurrence Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRecurrenceType()
* @generated
* @ordered
*/
protected static final RecurrenceType RECURRENCE_TYPE_EDEFAULT = RecurrenceType.RANDOM;
/**
* The cached value of the '{@link #getRecurrenceType() <em>Recurrence Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRecurrenceType()
* @generated
* @ordered
*/
protected RecurrenceType recurrenceType = RECURRENCE_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RecurrenceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RTMGCPackage.Literals.RECURRENCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RecurrenceType getRecurrenceType() {
return recurrenceType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRecurrenceType(RecurrenceType newRecurrenceType) {
RecurrenceType oldRecurrenceType = recurrenceType;
recurrenceType = newRecurrenceType == null ? RECURRENCE_TYPE_EDEFAULT : newRecurrenceType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RTMGCPackage.RECURRENCE__RECURRENCE_TYPE, oldRecurrenceType, recurrenceType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RTMGCPackage.RECURRENCE__RECURRENCE_TYPE:
return getRecurrenceType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RTMGCPackage.RECURRENCE__RECURRENCE_TYPE:
setRecurrenceType((RecurrenceType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RTMGCPackage.RECURRENCE__RECURRENCE_TYPE:
setRecurrenceType(RECURRENCE_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RTMGCPackage.RECURRENCE__RECURRENCE_TYPE:
return recurrenceType != RECURRENCE_TYPE_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(" (recurrenceType: ");
result.append(recurrenceType);
result.append(')');
return result.toString();
}
} //RecurrenceImpl