blob: cd91e6e12afbc4ee785274a599b733f404d4ec9c [file] [log] [blame]
/**
* Copyright (c) 2012, 2015 INRIA and Mia-Software.
* 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
*
* Contributors:
* Guillaume Doux (INRIA) - Initial API and implementation
* Grégoire Dupé (Mia-Software) - Bug 483292 - [Benchmark] long must be used to store memory usage
* Grégoire Dupé (Mia-Software) - Bug 483400 - [Benchmark] The input size should be computable by the discoverer
*/
package org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.BenchmarkPackage;
import org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.Event;
import org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.EventType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Event</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl.EventImpl#getTime <em>Time</em>}</li>
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl.EventImpl#getEventType <em>Event Type</em>}</li>
* </ul>
*
* @generated
*/
public class EventImpl extends EObjectImpl implements Event {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2012, 2015 INRIA and Mia-Software.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Guillaume Doux (INRIA) - Initial API and implementation\r\n Grégoire Dupé (Mia-Software) - Bug 483292 - [Benchmark] long must be used to store memory usage\r\n Grégoire Dupé (Mia-Software) - Bug 483400 - [Benchmark] The input size should be computable by the discoverer\r\n";
/**
* The default value of the '{@link #getTime() <em>Time</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTime()
* @generated
* @ordered
*/
protected static final long TIME_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getTime() <em>Time</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTime()
* @generated
* @ordered
*/
protected long time = TIME_EDEFAULT;
/**
* The cached value of the '{@link #getEventType() <em>Event Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEventType()
* @generated
* @ordered
*/
protected EventType eventType;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EventImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BenchmarkPackage.Literals.EVENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getTime() {
return time;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTime(long newTime) {
long oldTime = time;
time = newTime;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.EVENT__TIME, oldTime, time));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EventType getEventType() {
if (eventType != null && eventType.eIsProxy()) {
InternalEObject oldEventType = (InternalEObject)eventType;
eventType = (EventType)eResolveProxy(oldEventType);
if (eventType != oldEventType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BenchmarkPackage.EVENT__EVENT_TYPE, oldEventType, eventType));
}
}
return eventType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EventType basicGetEventType() {
return eventType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEventType(EventType newEventType) {
EventType oldEventType = eventType;
eventType = newEventType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.EVENT__EVENT_TYPE, oldEventType, eventType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BenchmarkPackage.EVENT__TIME:
return getTime();
case BenchmarkPackage.EVENT__EVENT_TYPE:
if (resolve) return getEventType();
return basicGetEventType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BenchmarkPackage.EVENT__TIME:
setTime((Long)newValue);
return;
case BenchmarkPackage.EVENT__EVENT_TYPE:
setEventType((EventType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BenchmarkPackage.EVENT__TIME:
setTime(TIME_EDEFAULT);
return;
case BenchmarkPackage.EVENT__EVENT_TYPE:
setEventType((EventType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BenchmarkPackage.EVENT__TIME:
return time != TIME_EDEFAULT;
case BenchmarkPackage.EVENT__EVENT_TYPE:
return eventType != null;
}
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(" (time: ");
result.append(time);
result.append(')');
return result.toString();
}
} //EventImpl