Class JavaAbstractClass
-
Field Summary
Fields declared in interface com.ibm.dtfj.java.JavaClass
MODIFIERS_UNAVAILABLE
-
Constructor Summary
ModifierConstructorDescriptionprotected
JavaAbstractClass
(JavaRuntime vm, ImagePointer id, int modifiers, long loaderID, ImagePointer objectID, int flagOffset, int hashcodeSlot) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
addInterfaceName
(String interfaceName) protected void
boolean
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.Fetch the class loader associated with this class.int
Returns the size of the extra slot needed for stored hashcode - if the object was moved - in JVMs built with J9VM_OPT_NEW_OBJECT_HASH.getID()
The ID of a class is a pointer to a section of memory which identifies the class.abstract int
getInstanceSize
(JavaObject instance) Get the set of names of interfaces directly implemented by this class.int
Return the Java language modifiers for this class.Fetch the java.lang.Class object associated with this class.Returns the protection domain for this class.int
hashCode()
Answers an integer hash code for the receiver.int
readFlagsFromInstance
(JavaObject instance) 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.JavaClass
getComponentType, getConstantPoolReferences, getDeclaredFields, getDeclaredMethods, getInstanceSize, getName, getReferences, getSuperclass, isArray
-
Field Details
-
_classPointer
-
_javaVM
-
-
Constructor Details
-
JavaAbstractClass
protected JavaAbstractClass(JavaRuntime vm, ImagePointer id, int modifiers, long loaderID, ImagePointer objectID, int flagOffset, int hashcodeSlot)
-
-
Method Details
-
getClassLoader
Description copied from interface:JavaClass
Fetch the class loader associated with this class. Classes defined in the bootstrap class loader (including classes representing primitive types or void) will always return a JavaClassLoader representing the bootstrap class loader. This asymmetry with java.lang.Class#getClassLoader() is intentional.- Specified by:
getClassLoader
in interfaceJavaClass
- Returns:
- the JavaClassLoader in which this class was defined
- Throws:
CorruptDataException
- if the class loader for this class cannot be found (a class cannot exist without a loader so this implies corruption)
-
getObject
Description copied from interface:JavaClass
Fetch the java.lang.Class object associated with this class.In some implementations this may be null if no object has been created to represent this class, or if the class is synthetic.
- Specified by:
getObject
in interfaceJavaClass
- Returns:
- the java.lang.Class object associated with this class
- Throws:
CorruptDataException
- See Also:
-
getModifiers
Description copied from interface:JavaClass
Return the Java language modifiers for this class.The modifiers are defined by the JVM Specification.
Return MODIFIERS_UNAVAILABLE if the modifiers are unavailable. This might be the case if DTFJ is operating against an artefact such as a portable heap dump that does not contain information about a class's modifiers.
Note that, for inner classes, the actual modifiers are returned, not the synthetic modifiers. For instance, a class will never have its 'protected' modifier set, even if the inner class was a protected member, since 'protected' is not a legal modifier for a class file.
- Specified by:
getModifiers
in interfaceJavaClass
- Returns:
- the modifiers for this class
- Throws:
CorruptDataException
-
getID
Description copied from interface:JavaClass
The ID of a class is a pointer to a section of memory which identifies the class. The contents of this memory are implementation defined.In some implementations getID() and getObject().getID() may return the same value. This implies that the class object is also the primary internal representation of the class. DTFJ users should not rely on this behaviour.
In some implementations, getID() may return null for some classes. This indicates that the class is a synthetic class which has been constructed for DTFJ purposes only. The class has no physical representation in the VM.
-
getInterfaces
Description copied from interface:JavaClass
Get the set of names of interfaces directly implemented by this class.- Specified by:
getInterfaces
in interfaceJavaClass
- Returns:
- an iterator over the collection of the names of interfaces directly implemented by this class. Some JVM implementations may choose to load interfaces lazily, so only the names are returned. The JavaClass objects may be found through the defining class loader.
- See Also:
-
addInterfaceName
-
getInstanceSize
- Parameters:
instance
- The instance is needed for array types to calculate the size of a per-instance basis- Returns:
- The size, in bytes, of an instance of this class (required for iterating the heap)
-
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 (==). -
getHashcodeSlotSize
public int getHashcodeSlotSize()Returns the size of the extra slot needed for stored hashcode - if the object was moved - in JVMs built with J9VM_OPT_NEW_OBJECT_HASH. If the hashcode could fit in spare space in the object header, this will return 0. . *- Returns:
- object instance size delta, in bytes
-
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. -
readFlagsFromInstance
public int readFlagsFromInstance(JavaObject instance) throws MemoryAccessException, CorruptDataException -
addClassLoaderReference
-
addSuperclassReference
-
addClassObjectReference
-
getProtectionDomain
Description copied from interface:JavaClass
Returns the protection domain for this class.- Specified by:
getProtectionDomain
in interfaceJavaClass
- Returns:
- the protection domain or null for the default protection domain
- Throws:
DataUnavailable
CorruptDataException
-