41 |
|
|
42 |
import java.io.DataOutputStream; |
import java.io.DataOutputStream; |
43 |
import java.io.IOException; |
import java.io.IOException; |
44 |
|
import java.lang.ref.SoftReference; |
45 |
|
|
46 |
/** |
/** |
47 |
* A baseclass for all object types reported to the debugger |
* A baseclass for all object types reported to the debugger |
63 |
private byte _tag; |
private byte _tag; |
64 |
|
|
65 |
/** |
/** |
66 |
|
* The object/class represented by this Id |
67 |
|
*/ |
68 |
|
protected SoftReference _reference; |
69 |
|
|
70 |
|
/** |
71 |
* Constructs an empty <code>JdwpId</code> |
* Constructs an empty <code>JdwpId</code> |
72 |
*/ |
*/ |
73 |
public JdwpId (byte tag) |
public JdwpId (byte tag) |
78 |
/** |
/** |
79 |
* Sets the id for this object reference |
* Sets the id for this object reference |
80 |
*/ |
*/ |
81 |
void setId (long id) |
public void setId (long id) |
82 |
{ |
{ |
83 |
_id = id; |
_id = id; |
84 |
} |
} |
92 |
} |
} |
93 |
|
|
94 |
/** |
/** |
95 |
|
* Gets the object/class reference for this ID |
96 |
|
* |
97 |
|
* @returns a refernce to the object or class |
98 |
|
*/ |
99 |
|
public SoftReference getReference () |
100 |
|
{ |
101 |
|
return _reference; |
102 |
|
} |
103 |
|
|
104 |
|
/** |
105 |
|
* Sets the object/class reference for this ID |
106 |
|
* |
107 |
|
* @param ref a refernce to the object or class |
108 |
|
*/ |
109 |
|
public void setReference (SoftReference ref) |
110 |
|
{ |
111 |
|
_reference = ref; |
112 |
|
} |
113 |
|
|
114 |
|
/** |
115 |
* Compares two object ids for equality. Two object ids |
* Compares two object ids for equality. Two object ids |
116 |
* are equal if they point to the same type and contain to |
* are equal if they point to the same type and contain to |
117 |
* the same id number. (NOTE: This is a much stricter check |
* the same id number. |
|
* than is necessary: all <code>JdwpId</code>s have unique |
|
|
* ids.) |
|
118 |
*/ |
*/ |
119 |
public boolean equals (JdwpId id) |
public boolean equals (JdwpId id) |
120 |
{ |
{ |
121 |
return ((id.getClass () == getClass ()) && (id.getId () == getId ())); |
return (id.getId () == getId ()); |
122 |
} |
} |
123 |
|
|
124 |
/** |
/** |