KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > inf > iks > jvmai > jvmdi > JoinPointLocation


1 //
2
// This file is part of the prose package.
3
//
4
// The contents of this file are subject to the Mozilla Public License
5
// Version 1.1 (the "License"); you may not use this file except in
6
// compliance with the License. You may obtain a copy of the License at
7
// http://www.mozilla.org/MPL/
8
//
9
// Software distributed under the License is distributed on an "AS IS" basis,
10
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
// for the specific language governing rights and limitations under the
12
// License.
13
//
14
// The Original Code is prose.
15
//
16
// The Initial Developer of the Original Code is Andrei Popovici. Portions
17
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18
// All Rights Reserved.
19
//
20
// Contributor(s):
21
// $Id: JoinPointLocation.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
22
// =====================================================================
23
//
24
// (history at end)
25
//
26

27 package ch.ethz.inf.iks.jvmai.jvmdi;
28
29 import java.lang.*;
30 import java.lang.reflect.Method JavaDoc;
31
32 /**
33  * Class JoinPointLocation denotes a code location: a method
34  * plus a bytecode index. A join-point location is usually
35  * owned by a JoinPointContext, which needs the location information
36  * to obtain information about local variables.
37  *
38  * @version $Revision: 1.1.1.1 $
39  * @author Andrei Popovici
40  */

41 class JoinPointLocation
42 {
43
44     protected Method JavaDoc executingMethod;
45     protected int executingBci;
46
47     public JoinPointLocation()
48     {
49     executingMethod = null;
50     executingBci = -1;
51     }
52
53
54     public boolean equals(Object JavaDoc other)
55     {
56     JoinPointLocation otherLocation = null;
57     if (other instanceof JoinPointLocation)
58         {
59         otherLocation = (JoinPointLocation)other;
60         return
61             executingMethod.equals(otherLocation.executingMethod) &&
62             executingBci == otherLocation.executingBci;
63         }
64     else
65         return false;
66     }
67
68     public int hashCode()
69     {
70     return executingMethod.hashCode() + executingBci;
71     }
72 }
73
74
75 //======================================================================
76
//
77
// $Log: JoinPointLocation.java,v $
78
// Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
79
// Imported from ETH Zurich
80
//
81
// Revision 1.2 2003/03/04 16:09:36 popovici
82
// Documentation improvements
83
//
84
// Revision 1.1 2003/03/04 11:26:42 popovici
85
// Important refactorization step (march):
86
// - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
87
// - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
88
// structures
89
//
90
Popular Tags