java.lang.Object
com.ibm.dtfj.java.j9.JavaField
- All Implemented Interfaces:
JavaField
,JavaMember
- Direct Known Subclasses:
JavaInstanceField
,JavaStaticField
-
Field Summary
Modifier and TypeFieldDescriptionprotected JavaRuntime
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
ModifierConstructorDescriptionprotected
JavaField
(JavaRuntime vm, String name, String signature, int modifiers, long declaringClassID) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.get
(JavaObject object) Get the contents of an Object field.Get the class which declares this field or methoddouble
getDouble
(JavaObject object) Get the contents of a double field.float
getFloat
(JavaObject object) Get the contents of a float field.int
getInt
(JavaObject object) Get the contents of an int field.long
getLong
(JavaObject object) Get the contents of a long field.int
Get the set of modifiers for this field or method - a set of bitsgetName()
Get the name of the field or methodprotected abstract Object
getReferenceType
(JavaObject object) short
getShort
(JavaObject object) Get the contents of a short field.Get the signature of the field or methodgetString
(JavaObject hostObject) Get the contents of a string field.int
hashCode()
Answers an integer hash code for the receiver.Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface com.ibm.dtfj.java.JavaField
getBoolean, getByte, getChar, isNestedPacked, isNestedPackedArray
-
Field Details
-
BOOLEAN_SIGNATURE
- See Also:
-
BYTE_SIGNATURE
- See Also:
-
CHAR_SIGNATURE
- See Also:
-
SHORT_SIGNATURE
- See Also:
-
INTEGER_SIGNATURE
- See Also:
-
LONG_SIGNATURE
- See Also:
-
FLOAT_SIGNATURE
- See Also:
-
DOUBLE_SIGNATURE
- See Also:
-
OBJECT_PREFIX_SIGNATURE
- See Also:
-
ARRAY_PREFIX_SIGNATURE
- See Also:
-
_javaVM
-
-
Constructor Details
-
JavaField
protected JavaField(JavaRuntime vm, String name, String signature, int modifiers, long declaringClassID)
-
-
Method Details
-
get
Description copied from interface:JavaField
Get the contents of an Object field.- Specified by:
get
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- a JavaObject instance for reference type fields, an instance of a subclass of Number, Boolean, or Character for primitive fields, or null for null reference fields This field must be declared in the object's class or in a superclass.
- Throws:
CorruptDataException
MemoryAccessException
- See Also:
-
getLong
Description copied from interface:JavaField
Get the contents of a long field.- Specified by:
getLong
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataException
MemoryAccessException
-
getDouble
Description copied from interface:JavaField
Get the contents of a double field.- Specified by:
getDouble
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataException
MemoryAccessException
-
getFloat
Description copied from interface:JavaField
Get the contents of a float field.- Specified by:
getFloat
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataException
MemoryAccessException
-
getInt
Description copied from interface:JavaField
Get the contents of an int field.- Specified by:
getInt
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataException
MemoryAccessException
-
getShort
Description copied from interface:JavaField
Get the contents of a short field.- Specified by:
getShort
in interfaceJavaField
- Parameters:
object
- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataException
MemoryAccessException
-
getReferenceType
protected abstract Object getReferenceType(JavaObject object) throws CorruptDataException, MemoryAccessException -
getModifiers
Description copied from interface:JavaMember
Get the set of modifiers for this field or method - a set of bits- Specified by:
getModifiers
in interfaceJavaMember
- Returns:
- the modifiers for this field or method. The values for the constants representing the modifiers can be obtained from java.lang.reflect.Modifier.
- Throws:
CorruptDataException
-
getDeclaringClass
Description copied from interface:JavaMember
Get the class which declares this field or method- Specified by:
getDeclaringClass
in interfaceJavaMember
- Returns:
- the JavaClass which declared this field or method
- Throws:
CorruptDataException
-
getName
Description copied from interface:JavaMember
Get the name of the field or method- Specified by:
getName
in interfaceJavaMember
- Returns:
- the name of the field or method
- Throws:
CorruptDataException
-
getSignature
Description copied from interface:JavaMember
Get the signature of the field or method- Specified by:
getSignature
in interfaceJavaMember
- Returns:
- the signature of the field or method. e.g. "(Ljava/lang/String;)V"
- Throws:
CorruptDataException
-
getString
Description copied from interface:JavaField
Get the contents of a string field.- Specified by:
getString
in interfaceJavaField
- Parameters:
hostObject
- to fetch the field from. Ignored for static fields.- Returns:
- a String representing the value of the String field. Note that the instance returned can be null if the field was null in object.
- Throws:
CorruptDataException
MemoryAccessException
-
equals
Description copied from class:java.lang.Object
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Specified by:
equals
in interfaceJavaMember
- Overrides:
equals
in classObject
- Parameters:
obj
- Object the object to compare with this object.- Returns:
- boolean
true
if the object is the same as this objectfalse
if it is different from this object. - See Also:
-
hashCode
public int hashCode()Description copied from class:java.lang.Object
Answers an integer hash code for the receiver. Any two objects which answertrue
when passed to.equals
must answer the same value for this method.- Specified by:
hashCode
in interfaceJavaMember
- Overrides:
hashCode
in classObject
- Returns:
- the receiver's hash.
- See Also:
-