BASE_ID, GLOBAL_ID, LEVEL_ID, ROOT_ID, THIS_ID, TRAITS_TYPE_NAME, UNDEFINED, UNKNOWN_ID
Constructor and Description |
---|
DValue(int type,
String typeName,
String className,
int attribs,
Object value,
int isolateId)
Create a value.
|
DValue(long id,
int isolateId)
Create a top-level variable which has no parent.
|
Modifier and Type | Method and Description |
---|---|
void |
addInheritedPrivateMember(DVariable v) |
void |
addMember(DVariable v) |
DVariable |
findMember(String named) |
static DValue |
forPrimitive(Object primitiveValue,
int isolateId)
Constructs a DValue for a primitive value (null, undefined, Boolean, Number, String).
|
int |
getAttributes()
Variable attributes define further information
regarding the variable.
|
String[] |
getClassHierarchy(boolean allLevels)
Returns the list of classes that contributed members to this object, from
the class itself all the way down to
Object (or, if
allLevels == false, down to the lowest-level class that actually
contributed members). |
String |
getClassName()
The class name of the value.
|
long |
getId()
Returns a unique ID for the object referred to by this variable.
|
int |
getIsolateId()
Get the worker id of the isolate to which this value belongs.
|
int |
getMemberCount(Session s)
Returns the number of child members of this variable.
|
Variable |
getMemberNamed(Session s,
String name)
Returns a specific child member of this variable.
|
Variable[] |
getMembers(Session s)
Returns all child members of this variable.
|
Variable[] |
getPrivateInheritedMemberNamed(String name)
Get all the private variables with the given name.
|
Variable[] |
getPrivateInheritedMembers()
Returns all child members of this variable that are private and are present
in its inheritance chain.
|
int |
getType()
Variable type can be one of VariableType.OBJECT,
VariableType.FUNCTION, VariableType.NUMBER, VariableType.STRING,
VariableType.UNDEFINED, VariableType.NULL.
|
String |
getTypeName()
The type name of the value:
"Number"
"Boolean"
"String"
"null"
"undefined"
Value.TRAITS_TYPE_NAME if this value represents the
traits of a class
"[package::]Classname@hexaddr" if this value
represents an instance of a non-primitive object. |
Object |
getValueAsObject()
Returns the value of the variable, as an Object.
|
String |
getValueAsString()
Returns the value of the variable, converted to a string.
|
static String |
getValueAsString(Object value) |
boolean |
isAttributeSet(int variableAttribute) |
boolean |
membersObtained() |
String |
membersToString() |
void |
removeAllMembers() |
void |
setAttributes(int f) |
void |
setClassHierarchy(String[] classHierarchy,
int levelsWithMembers) |
void |
setClassName(String s) |
void |
setIsolateId(int isolateid) |
void |
setMembersObtained(boolean obtained) |
void |
setSession(Session s) |
void |
setType(int t) |
void |
setTypeName(String s) |
void |
setValue(Object o) |
String |
toString()
Necessary for expression evaluation.
|
public DValue(long id, int isolateId)
id
- the ID of the variablepublic DValue(int type, String typeName, String className, int attribs, Object value, int isolateId)
type
- see VariableType
typeName
- className
- attribs
- the attributes of this value; see ValueAttribute
value
- for an Object or MovieClip, this should be a Long which contains the
ID of this variable. For a variable of any other type, such as integer
or string, this should be the value of the variable.isolateId
- the worker to which this value belongspublic static DValue forPrimitive(Object primitiveValue, int isolateId)
public int getIsolateId()
Value
getIsolateId
in interface Value
public void setIsolateId(int isolateid)
public int getAttributes()
Value
getAttributes
in interface Value
VariableAttribute
public String getClassName()
Value
DVariable.classNameFor(long, boolean)
.
In the AS3 world, the only possible return values from this function are:
"Object"
for instances of non-primitive classes such
as Object, Array, etc. ""
all primitive values (Number, Boolean, String,
null, undefined), or the traits of a class. getClassName
in interface Value
public long getId()
Value
UNKNOWN_ID
.public int getMemberCount(Session s) throws NotSuspendedException, NoResponseException, NotConnectedException
Value
getMemberCount
in interface Value
NotSuspendedException
NoResponseException
NotConnectedException
public Variable getMemberNamed(Session s, String name) throws NotSuspendedException, NoResponseException, NotConnectedException
Value
Object or MovieClip.
getMemberNamed
in interface Value
s
- the sessionname
- just a varname name, without its namespace (see getName()
)NotSuspendedException
NoResponseException
NotConnectedException
public String[] getClassHierarchy(boolean allLevels)
Value
Object
(or, if
allLevels == false, down to the lowest-level class that actually
contributed members).getClassHierarchy
in interface Value
allLevels
- if true
, the caller wants the entire class
hierarchy. If false
, the caller wants only
that portion of the class hierarchy that actually contributed
member variables to the object. For example,
Object
has no members, so if the caller passes
true
then the returned array of strings will
always end with Object
, but if the caller
passes false
then the returned array of strings
will never end with Object
.public Variable[] getMembers(Session s) throws NotSuspendedException, NoResponseException, NotConnectedException
Value
getMembers
in interface Value
NotSuspendedException
NoResponseException
NotConnectedException
public boolean membersObtained()
public void setMembersObtained(boolean obtained)
public void addMember(DVariable v)
public void addInheritedPrivateMember(DVariable v)
public void removeAllMembers()
public int getType()
Value
public String getTypeName()
Value
"Number"
"Boolean"
"String"
"null"
"undefined"
Value.TRAITS_TYPE_NAME
if this value represents the
traits of a class "[package::]Classname@hexaddr"
if this value
represents an instance of a non-primitive object. For example, if this is
an instance of mx.core.Application, the type name might be
"mx.core::Application@1234abcd". getTypeName
in interface Value
public Object getValueAsObject()
Value
null
Value.UNDEFINED
Boolean
Double
(careful, it might be Double.NaN
) String
Long
if this value represents a non-primitive
type, such as an Object. If it is a Long, then it is the id of
the Value (the same value returned by getId()
).
getValueAsObject
in interface Value
public String getValueAsString()
Value
getValueAsString
in interface Value
public static String getValueAsString(Object value)
value
- an object which might be one of these types:
Boolean, Integer, Long, Double, String, Value.UNDEFINED (representing
the value 'undefined'); or null.public boolean isAttributeSet(int variableAttribute)
isAttributeSet
in interface Value
VariableAttribute
public void setTypeName(String s)
public void setClassName(String s)
public void setType(int t)
public void setValue(Object o)
public void setAttributes(int f)
public void setClassHierarchy(String[] classHierarchy, int levelsWithMembers)
public String membersToString()
public void setSession(Session s)
public String toString()
toString
in class Object
Context.lookup(Object)
public Variable[] getPrivateInheritedMembers()
Value
getPrivateInheritedMembers
in interface Value
public Variable[] getPrivateInheritedMemberNamed(String name)
Value
getPrivateInheritedMemberNamed
in interface Value
name
- Variable name.Copyright © 2016 The Apache Software Foundation. All rights reserved.