|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IValue
Represents a value - either a primitive value or a reference. Used for field values and array elements.
Field Summary | |
---|---|
static IValue[] |
EMPTY_ARRAY
An empty IValue array. |
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
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()
|
Field Detail |
---|
static final IValue[] EMPTY_ARRAY
IValue
array.
Method Detail |
---|
boolean isPrimitive()
java.lang.Object getPrimitiveValue()
isPrimitive()
returns false.
IObjectInfo getReference()
isPrimitive()
returns true.
boolean isAssignableTo(java.lang.Class<?> type)
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 |
type
- one of the classes
above
type
and, if
type
is a primitive wrapper class, be unboxed.<T> T get(java.lang.Class<T> type)
object
representation
held by this instance if it can be assigned to a variable
declared as being of class type
, as per
isAssignableTo(Class)
. Otherwise, null is returned. Note that
null may be returned even if 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 |
T
- implicittype
- one of the classes
above, never null
T
(that is, a primitive wrapper or an
IObjectInfo
), or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |