|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jrockit.memleak.value.ReferenceValue
public class ReferenceValue
Represents a reference value that might be null. Used for field values and array elements.
| Field Summary |
|---|
| Fields inherited from interface com.jrockit.memleak.IValue |
|---|
EMPTY_ARRAY |
| Constructor Summary | |
|---|---|
ReferenceValue(IObjectInfo reference)
|
|
| Method Summary | ||
|---|---|---|
|
get(java.lang.Class<T> type)
Retrieve the actual primitive wrapper or object
representation held by this instance if it can be assigned to a variable
declared as being of class type, as per
IValue.isAssignableTo(Class). |
|
java.lang.Object |
getPrimitiveValue()
Returns the value of the primitive field. |
|
IObjectInfo |
getReference()
Returns the reference for this field. |
|
boolean |
isAssignableTo(java.lang.Class<?> type)
Check if the actual primitive wrapper or object
representation held by this instance and returned by get() can be assigned to a variable declared as being of class
type, with one additional requirement. |
|
boolean |
isPrimitive()
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReferenceValue(IObjectInfo reference)
reference - | Method Detail |
|---|
public final boolean isPrimitive()
isPrimitive in interface IValuepublic java.lang.Object getPrimitiveValue()
IValueIValue.isPrimitive() returns false.
getPrimitiveValue in interface IValuepublic final IObjectInfo getReference()
IValueIValue.isPrimitive() returns true.
getReference in interface IValuepublic boolean isAssignableTo(java.lang.Class<?> type)
IValueobject
representation held by this instance and returned by get() can be assigned to a variable declared as being of class
type, with one additional requirement. If type
is a primitive wrapper class, Number.class, or
Serializable.class, the value must also be non-null.
This is to facilitate safe unboxing into primitives.
This method is mainly usable for filters to differentiate between different kinds of primitives, as well as between primitives, references or arrays.
The full list of supported type arguments, and the
corresponding values from the actual heap they correspond to, is as
follows:
The primitive wrapper classes (Boolean.class,
Character.class, Byte.class, Short.class, Integer.class, Long.class,
Float.class, Double.class) |
Matches their corresponding primitive |
Number.class |
Matches byte, short, int, long, float, double |
Serializable.class |
Matches all primitives |
Object.class |
Matches all primitives and all references |
IObjectInfo.class |
Matches all references (including null) |
IArrayInfo.class |
Matches all references that are arrays or null |
isAssignableTo in interface IValuetype - one of the classes above
type and, if
type is a primitive wrapper class, be unboxed.public <T> T get(java.lang.Class<T> type)
IValueobject
representation held by this instance if it can be assigned to a variable
declared as being of class type, as per
IValue.isAssignableTo(Class). Otherwise, null is returned. Note that
null may be returned even if IValue.isAssignableTo(Class) with the same
type argument returns true, unless type is a
primitive wrapper class, Number.class, or
Serializable.class. This is to facilitate safe
unboxing into primitives.
The full list of supported type arguments, and the
corresponding values from the actual heap they correspond to, is as
follows:
The primitive wrapper classes (Boolean.class,
Character.class, Byte.class, Short.class, Integer.class, Long.class,
Float.class, Double.class) |
Matches their corresponding primitive |
Number.class |
Matches byte, short, int, long, float, double |
Serializable.class |
Matches all primitives |
Object.class |
Matches all primitives and all references |
IObjectInfo.class |
Matches all references (including null) |
IArrayInfo.class |
Matches all references that are arrays or null |
get in interface IValueT - implicittype - one of the classes above, never null
T (that is, a primitive wrapper or an
IObjectInfo), or nullpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||