亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? classdata.java

?? java覆蓋率測試工具
?? JAVA
字號:
/*
 * Cobertura - http://cobertura.sourceforge.net/
 *
 * Copyright (C) 2003 jcoverage ltd.
 * Copyright (C) 2005 Mark Doliner
 * Copyright (C) 2006 Jiri Mares
 *
 * Cobertura is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * Cobertura is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Cobertura; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */

package net.sourceforge.cobertura.coveragedata;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

/**
 * <p>
 * ProjectData information is typically serialized to a file. An
 * instance of this class records coverage information for a single
 * class that has been instrumented.
 * </p>
 *
 * <p>
 * This class implements HasBeenInstrumented so that when cobertura
 * instruments itself, it will omit this class.  It does this to
 * avoid an infinite recursion problem because instrumented classes
 * make use of this class.
 * </p>
 */

public class ClassData extends CoverageDataContainer
	implements Comparable, HasBeenInstrumented 
{

	private static final long serialVersionUID = 5;

	/**
	 * Each key is a line number in this class, stored as an Integer object.
	 * Each value is information about the line, stored as a LineData object.
	 */
	private Map branches = new HashMap();

	private boolean containsInstrumentationInfo = false;

	private Set methodNamesAndDescriptors = new HashSet();

	private String name = null;

	private String sourceFileName = null;

	/**
	 * @param name In the format "net.sourceforge.cobertura.coveragedata.ClassData"
	 */
	public ClassData(String name)
	{
		if (name == null)
			throw new IllegalArgumentException(
				"Class name must be specified.");
		this.name = name;
	}

	public LineData addLine(int lineNumber, String methodName,
			String methodDescriptor)
	{
		LineData lineData = getLineData(lineNumber);
		if (lineData == null)
		{
			lineData = new LineData(lineNumber);
			// Each key is a line number in this class, stored as an Integer object.
			// Each value is information about the line, stored as a LineData object.
			children.put(new Integer(lineNumber), lineData);
		}
		lineData.setMethodNameAndDescriptor(methodName, methodDescriptor);
      
		// methodName and methodDescriptor can be null when cobertura.ser with 
		// no line information was loaded (or was not loaded at all).
		if( methodName!=null && methodDescriptor!=null)
			methodNamesAndDescriptors.add(methodName + methodDescriptor);
		return lineData;
	}

	/**
	 * This is required because we implement Comparable.
	 */
	public int compareTo(Object o)
	{
		if (!o.getClass().equals(ClassData.class))
			return Integer.MAX_VALUE;
		return this.name.compareTo(((ClassData)o).name);
	}

	public boolean containsInstrumentationInfo()
	{
		return this.containsInstrumentationInfo;
	}

	/**
	 * Returns true if the given object is an instance of the
	 * ClassData class, and it contains the same data as this
	 * class.
	 */
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if ((obj == null) || !(obj.getClass().equals(this.getClass())))
			return false;

		ClassData classData = (ClassData)obj;
		return super.equals(obj)
			&& this.branches.equals(classData.branches)
			&& this.methodNamesAndDescriptors
				.equals(classData.methodNamesAndDescriptors)
			&& this.name.equals(classData.name)
			&& this.sourceFileName.equals(classData.sourceFileName);
	}

	public String getBaseName()
	{
		int lastDot = this.name.lastIndexOf('.');
		if (lastDot == -1)
		{
			return this.name;
		}
		return this.name.substring(lastDot + 1);
	}

	/**
	 * @return The branch coverage rate for a particular method.
	 */
	public double getBranchCoverageRate(String methodNameAndDescriptor)
	{
		int total = 0;
		int covered = 0;

		for (Iterator iter = branches.values().iterator(); iter.hasNext();) {
			LineData next = (LineData) iter.next();
			if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor()))
			{
				total += next.getNumberOfValidBranches();
				covered += next.getNumberOfCoveredBranches();
			}
		}
		if (total == 0) return 1.0;
		return (double) covered / total;
	}

	public Collection getBranches() 
	{
		return Collections.unmodifiableCollection(branches.keySet());
	}

	/**
	 * @param lineNumber The source code line number.
	 * @return The coverage of the line
	 */
	public LineData getLineCoverage(int lineNumber) 
	{
		Integer lineObject = new Integer(lineNumber);
		if (!children.containsKey(lineObject)) 
		{
			return null;
		}

		return (LineData) children.get(lineObject);
	}

	/**
	 * @return The line coverage rate for particular method
	 */
	public double getLineCoverageRate(String methodNameAndDescriptor) 
	{
		int total = 0;
		int hits = 0;

		Iterator iter = children.values().iterator();
		while (iter.hasNext()) 
		{
			LineData next = (LineData) iter.next();
			if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) 
			{
				total++;
				if (next.getHits() > 0) {
					hits++;
				}
			}
		}
		if (total == 0) return 1d;
		return (double) hits / total;
	}

	private LineData getLineData(int lineNumber)
	{
		return (LineData)children.get(new Integer(lineNumber));
	}

	public SortedSet getLines()
	{
		return new TreeSet(this.children.values());
	}

	public Collection getLines(String methodNameAndDescriptor)
	{
		Collection lines = new HashSet();
		Iterator iter = children.values().iterator();
		while (iter.hasNext())
		{
			LineData next = (LineData)iter.next();
			if (methodNameAndDescriptor.equals(next.getMethodName()
					+ next.getMethodDescriptor()))
			{
				lines.add(next);
			}
		}
		return lines;
	}

	/**
	 * @return The method name and descriptor of each method found in the
	 *         class represented by this instrumentation.
	 */
	public Set getMethodNamesAndDescriptors() 
	{
		return methodNamesAndDescriptors;
	}

	public String getName() 
	{
		return name;
	}

	/**
	 * @return The number of branches in this class.
	 */
	public int getNumberOfValidBranches() 
	{
		int number = 0;
		for (Iterator i = branches.values().iterator(); 
			i.hasNext(); 
			number += ((LineData) i.next()).getNumberOfValidBranches())
			;
		return number;
	}

	/**
	 * @see net.sourceforge.cobertura.coveragedata.CoverageData#getNumberOfCoveredBranches()
	 */
	public int getNumberOfCoveredBranches() 
	{
		int number = 0;
		for (Iterator i = branches.values().iterator(); 
			i.hasNext(); 
			number += ((LineData) i.next()).getNumberOfCoveredBranches())
			;
		return number;
	}

	public String getPackageName()
	{
		int lastDot = this.name.lastIndexOf('.');
		if (lastDot == -1)
		{
			return "";
		}
		return this.name.substring(0, lastDot);
	}

	 /**
	 * Return the name of the file containing this class.  If this
	 * class' sourceFileName has not been set (for whatever reason)
	 * then this method will attempt to infer the name of the source
	 * file using the class name.
	 *
	 * @return The name of the source file, for example
	 *         net/sourceforge/cobertura/coveragedata/ClassData.java
	 */
	public String getSourceFileName()
	{
		String baseName;
		if (sourceFileName != null)
			baseName = sourceFileName;
		else
		{
			baseName = getBaseName();
			int firstDollarSign = baseName.indexOf('$');
			if (firstDollarSign == -1 || firstDollarSign == 0)
				baseName += ".java";
			else
				baseName = baseName.substring(0, firstDollarSign)
					+ ".java";
		}

		String packageName = getPackageName();
		if (packageName.equals(""))
			return baseName;
		return packageName.replace('.', '/') + '/' + baseName;
	}

	public int hashCode()
	{
		return this.name.hashCode();
	}

	/**
	 * @return True if the line contains at least one condition jump (branch)
	 */
	public boolean hasBranch(int lineNumber) 
	{
		return branches.containsKey(new Integer(lineNumber));
	}

	/**
	 * Determine if a given line number is a valid line of code.
	 *
	 * @return True if the line contains executable code.  False
	 *         if the line is empty, or a comment, etc.
	 */
	public boolean isValidSourceLineNumber(int lineNumber) 
	{
		return children.containsKey(new Integer(lineNumber));
	}

	public void addLineJump(int lineNumber, int branchNumber) 
	{
		LineData lineData = getLineData(lineNumber);
		if (lineData != null) 
		{
			lineData.addJump(branchNumber);
			this.branches.put(new Integer(lineNumber), lineData);
		}
	}

	public void addLineSwitch(int lineNumber, int switchNumber, int[] keys) 
	{
		LineData lineData = getLineData(lineNumber);
		if (lineData != null) 
		{
			lineData.addSwitch(switchNumber, keys);
			this.branches.put(new Integer(lineNumber), lineData);
		}
	}

	public void addLineSwitch(int lineNumber, int switchNumber, int min, int max) 
	{
		LineData lineData = getLineData(lineNumber);
		if (lineData != null) 
		{
			lineData.addSwitch(switchNumber, min, max);
			this.branches.put(new Integer(lineNumber), lineData);
		}
	}

	/**
	 * Merge some existing instrumentation with this instrumentation.
	 *
	 * @param coverageData Some existing coverage data.
	 */
	public void merge(CoverageData coverageData)
	{
		ClassData classData = (ClassData)coverageData;

		// If objects contain data for different classes then don't merge
		if (!this.getName().equals(classData.getName()))
			return;

		super.merge(coverageData);

		// We can't just call this.branches.putAll(classData.branches);
		// Why not?  If we did a putAll, then the LineData objects from
		// the coverageData class would overwrite the LineData objects
		// that are already in "this.branches"  And we don't need to
		// update the LineData objects that are already in this.branches
		// because they are shared between this.branches and this.children,
		// so the object hit counts will be moved when we called
		// super.merge() above.
		for (Iterator iter = classData.branches.keySet().iterator(); iter.hasNext();)
		{
			Object key = iter.next();
			if (!this.branches.containsKey(key))
			{
				this.branches.put(key, classData.branches.get(key));
			}
		}

		this.containsInstrumentationInfo |= classData.containsInstrumentationInfo;
		this.methodNamesAndDescriptors.addAll(classData
				.getMethodNamesAndDescriptors());
		if (classData.sourceFileName != null)
			this.sourceFileName = classData.sourceFileName;
		}

	public void removeLine(int lineNumber)
	{
		Integer lineObject = new Integer(lineNumber);
		children.remove(lineObject);
		branches.remove(lineObject);
	}

	public void setContainsInstrumentationInfo()
	{
		this.containsInstrumentationInfo = true;
	}

	public void setSourceFileName(String sourceFileName)
	{
		this.sourceFileName = sourceFileName;
	}

	/**
	 * Increment the number of hits for a particular line of code.
	 *
	 * @param lineNumber the line of code to increment the number of hits.
	 */
	public void touch(int lineNumber)
	{
		LineData lineData = getLineData(lineNumber);
		if (lineData == null)
			lineData = addLine(lineNumber, null, null);
		lineData.touch();
	}

	/**
	 * Increments the number of hits for particular hit counter of particular branch on particular line number.
	 * 
	 * @param lineNumber The line of code where the branch is
	 * @param branchNumber  The branch on the line to change the hit counter
	 * @param branch The hit counter (true or false)
	 */
	public void touchJump(int lineNumber, int branchNumber, boolean branch) {
		LineData lineData = getLineData(lineNumber);
		if (lineData == null)
			lineData = addLine(lineNumber, null, null);
		lineData.touchJump(branchNumber, branch);
	}

	/**
	 * Increments the number of hits for particular hit counter of particular switch branch on particular line number.
	 * 
	 * @param lineNumber The line of code where the branch is
	 * @param switchNumber  The switch on the line to change the hit counter
	 * @param branch The hit counter 
	 */
	public void touchSwitch(int lineNumber, int switchNumber, int branch) {
		LineData lineData = getLineData(lineNumber);
		if (lineData == null)
			lineData = addLine(lineNumber, null, null);
		lineData.touchSwitch(switchNumber, branch);
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.66久久| 国产成人啪免费观看软件| 久久婷婷国产综合精品青草| 色综合亚洲欧洲| 精品一区二区三区日韩| 亚洲欧美激情视频在线观看一区二区三区| 欧美一级高清片| 91国产视频在线观看| 国产在线精品一区二区三区不卡| 亚洲午夜电影在线观看| 中文字幕日韩一区| 久久免费视频一区| 91精品国产一区二区三区香蕉 | 在线观看成人免费视频| 国产麻豆精品在线| 国内一区二区在线| 亚洲成人黄色小说| 亚洲三级免费观看| 中文字幕一区不卡| 国产三级三级三级精品8ⅰ区| 91精品国产综合久久久久久 | 日韩精品一区二区三区在线观看| 色播五月激情综合网| 不卡的电视剧免费网站有什么| 毛片一区二区三区| 日韩av一区二区在线影视| 一区二区三区在线视频播放| 国产精品久久久久久久久图文区| 久久久精品国产免费观看同学| 日韩视频一区在线观看| 欧美一区二区私人影院日本| 欧美日韩一级视频| 欧美日韩在线免费视频| 91国产丝袜在线播放| 在线影视一区二区三区| 一本久久综合亚洲鲁鲁五月天| 懂色av一区二区三区免费观看 | 国产精品日产欧美久久久久| 久久久久久久久久久久久女国产乱| 日韩一区二区三区免费看 | 91麻豆视频网站| 色综合色综合色综合色综合色综合| 丁香啪啪综合成人亚洲小说| 国产成人综合视频| 国产成人av一区二区三区在线 | 中文字幕中文字幕在线一区| 精品福利av导航| 久久中文娱乐网| 欧美韩国日本综合| 中文字幕人成不卡一区| 亚洲精品亚洲人成人网| 亚洲国产精品视频| 日韩激情视频在线观看| 九九精品视频在线看| 精品一区二区三区在线播放视频| 九色综合国产一区二区三区| 国产在线播放一区| 成人av网址在线观看| 色视频成人在线观看免| 欧美色图片你懂的| 欧美一区二区久久| 久久伊99综合婷婷久久伊| 中日韩免费视频中文字幕| 亚洲欧美另类久久久精品| 午夜精品福利一区二区蜜股av | 玖玖九九国产精品| 国产精品白丝jk黑袜喷水| 91在线视频网址| 欧美精品乱码久久久久久| 欧美mv和日韩mv的网站| 国产精品欧美一区喷水| 亚洲一区二区三区中文字幕| 强制捆绑调教一区二区| 成人手机电影网| 欧美艳星brazzers| 精品福利一区二区三区免费视频| 国产精品视频第一区| 亚洲与欧洲av电影| 免费成人在线影院| 不卡一区二区三区四区| 91精品在线一区二区| 国产性天天综合网| 亚洲综合视频在线观看| 精品一区二区三区免费播放| 成人91在线观看| 欧美乱妇一区二区三区不卡视频| 久久嫩草精品久久久久| 亚洲成a人在线观看| 国产成人免费网站| 欧美日韩国产三级| 国产精品久久久久久久久免费桃花| 亚洲成人资源网| 成人一区二区三区视频| 正在播放亚洲一区| 亚洲少妇30p| 极品少妇一区二区| 欧美亚洲精品一区| 精品少妇一区二区三区视频免付费 | 99v久久综合狠狠综合久久| 这里是久久伊人| 《视频一区视频二区| 久草在线在线精品观看| 欧美三级蜜桃2在线观看| 日本一区二区久久| 美脚の诱脚舐め脚责91 | 成a人片国产精品| 精品日韩欧美在线| 亚洲一区二区三区免费视频| 成人av网站免费| 久久一区二区三区四区| 免费三级欧美电影| 欧美日韩在线综合| 综合网在线视频| 成人免费高清在线| 久久精品免视看| 毛片av一区二区| 欧美精品一二三区| 亚洲国产欧美在线| 91丨porny丨户外露出| 久久久无码精品亚洲日韩按摩| 免费在线看成人av| 欧美日韩综合一区| 亚洲一二三四区| 色哟哟国产精品| 亚洲欧洲综合另类在线| 不卡的av网站| 国产精品久久久久久一区二区三区| 国产精品一区二区91| 精品国产伦一区二区三区观看方式 | 青青草精品视频| 欧美片在线播放| 视频一区欧美精品| 欧美丰满一区二区免费视频| 一区二区三区四区激情 | 91黄色免费看| 六月丁香婷婷久久| 日韩色视频在线观看| 日本午夜一区二区| 91精品麻豆日日躁夜夜躁| 日日欢夜夜爽一区| 制服丝袜av成人在线看| 日韩电影一区二区三区四区| 欧美日本韩国一区二区三区视频| 天天做天天摸天天爽国产一区| 欧美妇女性影城| 六月丁香婷婷色狠狠久久| 精品国产污网站| 国产91丝袜在线观看| 中文字幕日本乱码精品影院| 色综合天天做天天爱| 亚洲一区二区影院| 宅男噜噜噜66一区二区66| 日本vs亚洲vs韩国一区三区二区| 91精品国产综合久久久久久久久久 | 亚洲丝袜精品丝袜在线| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲欧美国产高清| 欧美日韩www| 国产麻豆一精品一av一免费 | 日本在线播放一区二区三区| 日韩一级视频免费观看在线| 国产一二三精品| 亚洲美女电影在线| 欧美喷潮久久久xxxxx| 国产一区二区在线观看免费| 欧美国产日韩一二三区| 欧美图片一区二区三区| 日韩精品一二区| 国产日韩三级在线| 色综合久久综合网欧美综合网| 污片在线观看一区二区| 2021中文字幕一区亚洲| 99久久久国产精品| 日本成人在线看| 国产精品拍天天在线| 欧美日韩在线一区二区| 韩国午夜理伦三级不卡影院| 亚洲天堂精品在线观看| 日韩一区二区免费视频| 99视频精品在线| 欧美aa在线视频| 自拍偷自拍亚洲精品播放| 日韩欧美一区二区久久婷婷| 99精品久久99久久久久| 美女网站色91| 亚洲精品国产无套在线观| 精品国产91久久久久久久妲己 | 久久亚洲一级片| 色综合久久88色综合天天6| 麻豆成人免费电影| 亚洲乱码国产乱码精品精小说| 日韩免费在线观看| 色屁屁一区二区| 国产精品一卡二卡在线观看| 亚洲电影欧美电影有声小说| 国产三级欧美三级日产三级99| 欧美性猛交xxxxxx富婆| jlzzjlzz亚洲女人18| 国产在线播放一区| 国产又黄又大久久|