/** | |
* 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.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.Resource; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Resource</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.ResourceImpl#getName <em>Name</em>}</li> | |
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl.ResourceImpl#getTotalSizeInBytes <em>Total Size In Bytes</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public abstract class ResourceImpl extends EObjectImpl implements Resource { | |
/** | |
* <!-- 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 #getName() <em>Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getName() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String NAME_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getName() <em>Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getName() | |
* @generated | |
* @ordered | |
*/ | |
protected String name = NAME_EDEFAULT; | |
/** | |
* The default value of the '{@link #getTotalSizeInBytes() <em>Total Size In Bytes</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTotalSizeInBytes() | |
* @generated | |
* @ordered | |
*/ | |
protected static final long TOTAL_SIZE_IN_BYTES_EDEFAULT = 0L; | |
/** | |
* The cached value of the '{@link #getTotalSizeInBytes() <em>Total Size In Bytes</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTotalSizeInBytes() | |
* @generated | |
* @ordered | |
*/ | |
protected long totalSizeInBytes = TOTAL_SIZE_IN_BYTES_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ResourceImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return BenchmarkPackage.Literals.RESOURCE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getName() { | |
return name; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setName(String newName) { | |
String oldName = name; | |
name = newName; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.RESOURCE__NAME, oldName, name)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public long getTotalSizeInBytes() { | |
return totalSizeInBytes; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setTotalSizeInBytes(long newTotalSizeInBytes) { | |
long oldTotalSizeInBytes = totalSizeInBytes; | |
totalSizeInBytes = newTotalSizeInBytes; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.RESOURCE__TOTAL_SIZE_IN_BYTES, oldTotalSizeInBytes, totalSizeInBytes)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case BenchmarkPackage.RESOURCE__NAME: | |
return getName(); | |
case BenchmarkPackage.RESOURCE__TOTAL_SIZE_IN_BYTES: | |
return getTotalSizeInBytes(); | |
} | |
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.RESOURCE__NAME: | |
setName((String)newValue); | |
return; | |
case BenchmarkPackage.RESOURCE__TOTAL_SIZE_IN_BYTES: | |
setTotalSizeInBytes((Long)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case BenchmarkPackage.RESOURCE__NAME: | |
setName(NAME_EDEFAULT); | |
return; | |
case BenchmarkPackage.RESOURCE__TOTAL_SIZE_IN_BYTES: | |
setTotalSizeInBytes(TOTAL_SIZE_IN_BYTES_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case BenchmarkPackage.RESOURCE__NAME: | |
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | |
case BenchmarkPackage.RESOURCE__TOTAL_SIZE_IN_BYTES: | |
return totalSizeInBytes != TOTAL_SIZE_IN_BYTES_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(" (name: "); | |
result.append(name); | |
result.append(", totalSizeInBytes: "); | |
result.append(totalSizeInBytes); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //ResourceImpl |