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 * $Id: $
   12 *******************************************************************************/
   13package org.jacoco.core.analysis;
   14
   15/**
   16 * Coverage data of a single source file. As source file contains one or more
   17 * classes.
   18 * 
   19 * @author Marc R. Hoffmann
   20 * @version $Revision: $
   21 */
   22public class SourceFileCoverage extends CoverageNodeImpl {
   23
   24    private final String packagename;
   25
   26    /**
   27     * Creates a source file data object with the given parameters.
   28     * 
   29     * @param name
   30     *            name of the source file
   31     * @param packagename
   32     *            vm name of the package the source file belongs to
   33     */
   34    public SourceFileCoverage(final String name, final String packagename) {
   35        super(ElementType.SOURCEFILE, name, true);
   36        this.packagename = packagename;
   37    }
   38
   39    /**
   40     * Returns the vm name of the package the source file belongs to.
   41     * 
   42     * @return package name
   43     */
   44    public String getPackageName() {
   45        return packagename;
   46    }
   47
   48}