KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mountainminds > eclemma > core > analysis > IJavaModelCoverage


1 /*******************************************************************************
2  * Copyright (c) 2006 Mountainminds GmbH & Co. KG
3  * This software is provided under the terms of the Eclipse Public License v1.0
4  * See http://www.eclipse.org/legal/epl-v10.html.
5  *
6  * $Id: IJavaModelCoverage.java 180 2006-11-19 20:20:44Z mtnminds $
7  ******************************************************************************/

8 package com.mountainminds.eclemma.core.analysis;
9
10 import org.eclipse.jdt.core.IJavaElement;
11 import org.eclipse.jdt.core.IJavaProject;
12 import org.eclipse.jdt.core.IPackageFragment;
13 import org.eclipse.jdt.core.IPackageFragmentRoot;
14 import org.eclipse.jdt.core.IType;
15
16 import com.mountainminds.eclemma.internal.core.analysis.Counter;
17
18 /**
19  * The interface for coverage information attached to the Java model. It allows
20  * to retrieve coverage information for any Java model element and holds lists
21  * of entry points.
22  *
23  * @author Marc R. Hoffmann
24  * @version $Revision: 180 $
25  */

26 public interface IJavaModelCoverage extends IJavaElementCoverage {
27   
28   /**
29    * This instance is used to indicate that a coverage session is currently
30    * loading.
31    */

32   public static final IJavaModelCoverage LOADING = new IJavaModelCoverage() {
33
34     public ILineCoverage getLineCoverage() {
35       return null;
36     }
37
38     public ICounter getBlockCounter() {
39       return Counter.COUNTER_0_0;
40     }
41
42     public ICounter getLineCounter() {
43       return Counter.COUNTER_0_0;
44     }
45
46     public ICounter getInstructionCounter() {
47       return Counter.COUNTER_0_0;
48     }
49
50     public ICounter getMethodCounter() {
51       return Counter.COUNTER_0_0;
52     }
53
54     public ICounter getTypeCounter() {
55       return Counter.COUNTER_0_0;
56     }
57
58     public long getResourceModificationStamp() {
59       return 0;
60     }
61
62     public IJavaProject[] getInstrumentedProjects() {
63       return new IJavaProject[0];
64     }
65
66     public IPackageFragmentRoot[] getInstrumentedPackageFragmentRoots() {
67       return new IPackageFragmentRoot[0];
68     }
69
70     public IPackageFragment[] getInstrumentedPackageFragments() {
71       return new IPackageFragment[0];
72     }
73
74     public IType[] getInstrumentedTypes() {
75       return new IType[0];
76     }
77
78     public IJavaElementCoverage getCoverageFor(IJavaElement element) {
79       return null;
80     }
81     
82   };
83   
84   /**
85    * Returns all Java projects where coverage information is available for.
86    *
87    * @return list of Java projects
88    */

89   public IJavaProject[] getInstrumentedProjects();
90
91   /**
92    * Returns all package fragment roots where coverage information is available
93    * for.
94    *
95    * @return list of package fragment roots.
96    */

97   public IPackageFragmentRoot[] getInstrumentedPackageFragmentRoots();
98
99   /**
100    * Returns all package fragments where coverage information is available for.
101    *
102    * @return list of package fragments
103    */

104   public IPackageFragment[] getInstrumentedPackageFragments();
105
106   /**
107    * Returns all Java types where coverage information is available for.
108    *
109    * @return list of Java types
110    */

111   public IType[] getInstrumentedTypes();
112   
113   /**
114    * Returns the coverage information associated with the given Java element. If
115    * no information is available <code>null</code> is returned.
116    *
117    * @param element Java element to look for coverage information
118    * @return associated coverage information of null
119    */

120   public IJavaElementCoverage getCoverageFor(IJavaElement element);
121   
122 }
123
Popular Tags