SourceFileCoverage.java
1/*******************************************************************************
2 * Copyright (c) 2009, 2010 Mountainminds GmbH & Co. KG and Contributors
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Marc R. Hoffmann - initial API and implementation
10 *
11 *******************************************************************************/
12package org.jacoco.core.analysis;
13
14/**
15 * Coverage data of a single source file. As source file contains one or more
16 * classes.
17 *
18 * @author Marc R. Hoffmann
19 * @version 0.4.1.20101007204400
20 */
21public class SourceFileCoverage extends CoverageNodeImpl {
22
23 private final String packagename;
24
25 /**
26 * Creates a source file data object with the given parameters.
27 *
28 * @param name
29 * name of the source file
30 * @param packagename
31 * vm name of the package the source file belongs to
32 */
33 public SourceFileCoverage(final String name, final String packagename) {
34 super(ElementType.SOURCEFILE, name, true);
35 this.packagename = packagename;
36 }
37
38 /**
39 * Returns the vm name of the package the source file belongs to.
40 *
41 * @return package name
42 */
43 public String getPackageName() {
44 return packagename;
45 }
46
47}