1 /******************************************************************************* 2 * Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors 3 * This program and the accompanying materials are made available under 4 * the terms of the Eclipse Public License 2.0 which is available at 5 * http://www.eclipse.org/legal/epl-2.0 6 * 7 * SPDX-License-Identifier: EPL-2.0 8 * 9 * Contributors: 10 * Marc R. Hoffmann - initial API and implementation 11 * 12 *******************************************************************************/ 13 package org.jacoco.core.analysis; 14 15 /** 16 * Interface for coverage nodes that have individual source lines like methods, 17 * classes and source files. 18 */ 19 public interface ISourceNode extends ICoverageNode { 20 21 /** Place holder for unknown lines (no debug information) */ 22 int UNKNOWN_LINE = -1; 23 24 /** 25 * The number of the first line coverage information is available for. If no 26 * line is contained, the method returns -1. 27 * 28 * @return number of the first line or {@link #UNKNOWN_LINE} 29 */ getFirstLine()30 int getFirstLine(); 31 32 /** 33 * The number of the last line coverage information is available for. If no 34 * line is contained, the method returns -1. 35 * 36 * @return number of the last line or {@link #UNKNOWN_LINE} 37 */ getLastLine()38 int getLastLine(); 39 40 /** 41 * Returns the line information for given line. 42 * 43 * @param nr 44 * line number of interest 45 * @return line information 46 */ getLine(int nr)47 ILine getLine(int nr); 48 49 } 50