blob: 8e6e3162602b5c3722d1448e388d8c8f1c3fe76b [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.TimeHistogramEntry;
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>Time Histogram Entry</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.TimeHistogramEntryImpl#getOccurrences <em>Occurrences</em>}</li>
* </ul>
*
* @generated
*/
public class TimeHistogramEntryImpl extends TimeIntervalImpl implements TimeHistogramEntry {
/**
* The default value of the '{@link #getOccurrences() <em>Occurrences</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOccurrences()
* @generated
* @ordered
*/
protected static final long OCCURRENCES_EDEFAULT = 1L;
/**
* The cached value of the '{@link #getOccurrences() <em>Occurrences</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOccurrences()
* @generated
* @ordered
*/
protected long occurrences = OCCURRENCES_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TimeHistogramEntryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getTimeHistogramEntry();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public long getOccurrences() {
return occurrences;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setOccurrences(long newOccurrences) {
long oldOccurrences = occurrences;
occurrences = newOccurrences;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TIME_HISTOGRAM_ENTRY__OCCURRENCES, oldOccurrences, occurrences));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.TIME_HISTOGRAM_ENTRY__OCCURRENCES:
return getOccurrences();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.TIME_HISTOGRAM_ENTRY__OCCURRENCES:
setOccurrences((Long)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.TIME_HISTOGRAM_ENTRY__OCCURRENCES:
setOccurrences(OCCURRENCES_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.TIME_HISTOGRAM_ENTRY__OCCURRENCES:
return occurrences != OCCURRENCES_EDEFAULT;
}
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(" (occurrences: ");
result.append(occurrences);
result.append(')');
return result.toString();
}
} //TimeHistogramEntryImpl