blob: 6679bfddc126868d03a6fd637f2886cc052eb148 [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.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.File;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>File</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.FileImpl#getSizeInBytes <em>Size In Bytes</em>}</li>
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl.FileImpl#getLines <em>Lines</em>}</li>
* <li>{@link org.eclipse.modisco.infra.discovery.benchmark.metamodel.internal.benchmark.impl.FileImpl#getFilepath <em>Filepath</em>}</li>
* </ul>
*
* @generated
*/
public class FileImpl extends EObjectImpl implements File {
/**
* <!-- 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 #getSizeInBytes() <em>Size In Bytes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSizeInBytes()
* @generated
* @ordered
*/
protected static final long SIZE_IN_BYTES_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getSizeInBytes() <em>Size In Bytes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSizeInBytes()
* @generated
* @ordered
*/
protected long sizeInBytes = SIZE_IN_BYTES_EDEFAULT;
/**
* The default value of the '{@link #getLines() <em>Lines</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLines()
* @generated
* @ordered
*/
protected static final long LINES_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getLines() <em>Lines</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLines()
* @generated
* @ordered
*/
protected long lines = LINES_EDEFAULT;
/**
* The default value of the '{@link #getFilepath() <em>Filepath</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFilepath()
* @generated
* @ordered
*/
protected static final String FILEPATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getFilepath() <em>Filepath</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFilepath()
* @generated
* @ordered
*/
protected String filepath = FILEPATH_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FileImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BenchmarkPackage.Literals.FILE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getSizeInBytes() {
return sizeInBytes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSizeInBytes(long newSizeInBytes) {
long oldSizeInBytes = sizeInBytes;
sizeInBytes = newSizeInBytes;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.FILE__SIZE_IN_BYTES, oldSizeInBytes, sizeInBytes));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public long getLines() {
return lines;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLines(long newLines) {
long oldLines = lines;
lines = newLines;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.FILE__LINES, oldLines, lines));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFilepath() {
return filepath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFilepath(String newFilepath) {
String oldFilepath = filepath;
filepath = newFilepath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BenchmarkPackage.FILE__FILEPATH, oldFilepath, filepath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BenchmarkPackage.FILE__SIZE_IN_BYTES:
return getSizeInBytes();
case BenchmarkPackage.FILE__LINES:
return getLines();
case BenchmarkPackage.FILE__FILEPATH:
return getFilepath();
}
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.FILE__SIZE_IN_BYTES:
setSizeInBytes((Long)newValue);
return;
case BenchmarkPackage.FILE__LINES:
setLines((Long)newValue);
return;
case BenchmarkPackage.FILE__FILEPATH:
setFilepath((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BenchmarkPackage.FILE__SIZE_IN_BYTES:
setSizeInBytes(SIZE_IN_BYTES_EDEFAULT);
return;
case BenchmarkPackage.FILE__LINES:
setLines(LINES_EDEFAULT);
return;
case BenchmarkPackage.FILE__FILEPATH:
setFilepath(FILEPATH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BenchmarkPackage.FILE__SIZE_IN_BYTES:
return sizeInBytes != SIZE_IN_BYTES_EDEFAULT;
case BenchmarkPackage.FILE__LINES:
return lines != LINES_EDEFAULT;
case BenchmarkPackage.FILE__FILEPATH:
return FILEPATH_EDEFAULT == null ? filepath != null : !FILEPATH_EDEFAULT.equals(filepath);
}
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(" (sizeInBytes: ");
result.append(sizeInBytes);
result.append(", lines: ");
result.append(lines);
result.append(", filepath: ");
result.append(filepath);
result.append(')');
return result.toString();
}
} //FileImpl