KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > jiapi > instrumentor > HotSpot


1 package alt.jiapi.instrumentor;
2
3 import alt.jiapi.reflect.Instruction;
4 import alt.jiapi.reflect.InstructionList;
5
6 /**
7  * HotSpot represents an interesting point in InstructionList.
8  * HotSpot may be anything from zero length to size of the
9  * InstructionList.
10  *
11  * @author Mika Riekkinen
12  * @author Joni Suominen
13  * @version $Revision: 1.4 $ $Date: 2004/03/29 13:36:31 $
14  */

15 public class HotSpot {
16     private int start;
17     private int end;
18     private Instruction startIns;
19     private Instruction endIns;
20     private InstructionList il;
21
22     public HotSpot(int start, int end) {
23         this.start = start;
24         this.end = end;
25     }
26
27     public HotSpot(InstructionList il, Instruction start, Instruction end) {
28         this.il = il;
29         this.startIns = start;
30         this.endIns = end;
31     }
32
33     /**
34      * Get method for start
35      * @return Start
36      */

37     public int getStart() {
38         return this.start;
39     }
40
41
42     /**
43      * Get method for end
44      * @return End
45      */

46     public int getEnd() {
47         return this.end;
48     }
49
50
51     public Instruction getStartInstruction() {
52         return startIns;
53     }
54
55     public Instruction getEndInstruction() {
56         return endIns;
57     }
58
59     public InstructionList getView() {
60         return il.createView(il.indexOf(startIns),
61                              il.indexOf(endIns) + 1);
62     }
63 }
64
Popular Tags