|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrockit.memleak.value.PrimitiveValue
public class PrimitiveValue
Represents a primitive value. Used for field values and array elements.
Field Summary |
---|
Fields inherited from interface com.jrockit.memleak.IValue |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
PrimitiveValue(java.lang.Object valueWrapper)
|
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 PrimitiveValue(java.lang.Object valueWrapper)
valueWrapper
- Method Detail |
---|
public final boolean isPrimitive()
isPrimitive
in interface IValue
public java.lang.Object getPrimitiveValue()
IValue
IValue.isPrimitive()
returns false.
getPrimitiveValue
in interface IValue
public final IObjectInfo getReference()
IValue
IValue.isPrimitive()
returns true.
getReference
in interface IValue
public boolean isAssignableTo(java.lang.Class<?> type)
IValue
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. 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 IValue
type
- 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)
IValue
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)
. 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 IValue
T
- 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 |