01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Aleksey V. Yantsen
21: * @version $Revision: 1.3 $
22: */
23:
24: /**
25: * Created on 10.25.2004
26: */package org.apache.harmony.jpda.tests.framework.jdwp;
27:
28: import org.apache.harmony.jpda.tests.framework.jdwp.JDWPConstants;
29:
30: /**
31: * This class represents Location value in JDWP packet.
32: */
33: public class Location {
34: public byte tag;
35: public long classID;
36: public long methodID;
37: public long index;
38:
39: /**
40: * Creates new Location value with empty data.
41: */
42: public Location() {
43: tag = JDWPConstants.Tag.NO_TAG;
44: classID = 0;
45: methodID = 0;
46: index = 0;
47: }
48:
49: /**
50: * Creates new Location value with specified data.
51: */
52: Location(byte tag, long classID, long methodID, long index) {
53: this .tag = tag;
54: this .classID = classID;
55: this .methodID = methodID;
56: this .index = index;
57: }
58:
59: /**
60: * Converts Location to string format for printing.
61: */
62: public String toString() {
63: return "Location: tag=" + tag + ", classID=" + classID
64: + ", methodID=" + methodID + ", index=" + index;
65: }
66:
67: /**
68: * Compares this with other Location object.
69: */
70: public boolean equals(Object obj) {
71: if (!(obj instanceof Location))
72: return false;
73: Location loc = (Location) obj;
74: return classID == loc.classID && methodID == loc.methodID
75: && index == loc.index;
76:
77: }
78: }
|