com.ibm.dtfj.java

Interface JavaObject


  1. public interface JavaObject
Represents a Java Object.

Method Summary

Modifier and Type Method and Description
  1. void
arraycopy(int srcStart,java.lang.Object dst,int dstStart,int length)
Copies data from the image array into a local Java array.
  1. boolean
equals(java.lang.Object obj)
  1. int
getArraySize()
Get the number of elements in this array.
  1. long
getHashcode()
Fetch the basic hash code for the object.
  1. JavaHeap
getHeap()
Gets the heap where this object is located.
  1. ImagePointer
getID()
The ID of an object is a unique address is memory which identifies the object.
  1. JavaClass
getJavaClass()
Get the JavaClass instance which represents the class of this object.
  1. long
getPersistentHashcode()
Fetch the basic hash code of the object in the image.
  1. java.util.Iterator
getReferences()
Get the set of references from this object.
  1. java.util.Iterator
getSections()
An object is represented in the Java runtime by one or more regions of memory.
  1. long
getSize()
Get the number of bytes of memory occupied by this object.
  1. int
hashCode()
  1. boolean
isArray()
Is this object an array ?

Method Detail

getJavaClass

  1. JavaClass getJavaClass()
  2. throws CorruptDataException
Get the JavaClass instance which represents the class of this object.
Returns:
the JavaClass instance which represents the class of this object
Throws:

isArray

  1. boolean isArray()
  2. throws CorruptDataException
Is this object an array ?
Returns:
true if the receiver represents an instance of an array, or false otherwise
Throws:

getArraySize

  1. int getArraySize()
  2. throws CorruptDataException
Get the number of elements in this array.
Returns:
the number of elements in this array

Throws:
java.lang.IllegalArgumentException - if the receiver is not an array

arraycopy

  1. void arraycopy(int srcStart,
  2. java.lang.Object dst,
  3. int dstStart,
  4. int length)
  5. throws CorruptDataException
  6. MemoryAccessException
Copies data from the image array into a local Java array. The dst object must be an array of the appropriate type -- a base type array for base types, or a JavaObject array for reference arrays.
Parameters:
srcStart - index in the receiver to start copying from
dst - the destination array
dstStart - index in the destination array to start copying into
length - the number of elements to be copied
Throws:
java.lang.NullPointerException - if dst is null
java.lang.IllegalArgumentException - if the receiver is not an array, or if dst is not an array of the appropriate type
java.lang.IndexOutOfBoundsException - if srcStart, dstStart, or length are out of bounds in either the receiver or the destination array

getSize

  1. long getSize()
  2. throws CorruptDataException
Get the number of bytes of memory occupied by this object.
Returns:
the number of bytes of memory occupied by this object. The memory may not necessarily be contiguous
Throws:

getHashcode

  1. long getHashcode()
  2. throws DataUnavailable
  3. CorruptDataException
Fetch the basic hash code for the object. This is the hash code which would be returned if a Java thread had requested it. Typically the hash code is based on the address of an object, and may change if the object is moved by a garbage collect cycle.
Returns:
the basic hash code of the object in the image.
Throws:
DataUnavailable - if the hash code cannot be determined
See Also:

getPersistentHashcode

  1. long getPersistentHashcode()
  2. throws DataUnavailable
  3. CorruptDataException
Fetch the basic hash code of the object in the image. This hash code is guaranteed to be persistent between multiple snapshots of the same Image. If the hash code cannot be determined, or if the hash code for this object could change between snapshots, an exception is thrown.

If the VM uses a 'hasBeenHashed' bit, the value of this bit can be inferred by calling getPersistentHashcode(). If the persistent hash code is not available, then the 'hasBeenHashed' bit has not been set, and the hash of the object could change if the object moves between snapshots

Returns:
the basic hash code of the object in the image
Throws:
DataUnavailable - if a hash code cannot be determined, or if the hash code could change between successive snapshots
See Also:

getID

  1. ImagePointer getID()
The ID of an object is a unique address is memory which identifies the object. The data at this memory is implementation defined. The object may be non-contiguous. Portions of the object may appear below or above this address.
Returns:
the runtime-wide unique identifier for the object

getSections

  1. java.util.Iterator getSections( )
An object is represented in the Java runtime by one or more regions of memory. These include the object's header and the data in the object. In certain allocation strategies, an object's header and data may be allocated contiguously. In this case, this method may return an iterator for a single section. In other schemes, the header may be separate from the data or the data may be broken up into multiple regions. Additionally, this function does not guarantee that the memory used by this object is not also shared by one or more other objects. Callers should not make any assumptions about the contents of the memory.
Returns:
a collection of sections that make up this object
See Also:

getReferences

  1. java.util.Iterator getReferences( )
Get the set of references from this object.
Returns:
an iterator of JavaReferences
See Also:

getHeap

  1. JavaHeap getHeap()
  2. throws CorruptDataException
  3. DataUnavailable
Gets the heap where this object is located.
Returns:
the JavaHeap instance representing the heap where this object is stored in memory.
Throws:
CorruptDataException - if the heap information for this object is corrupt.
DataUnavailable - if the heap information for this object is not available.
See Also:

equals

  1. boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True if the given object refers to the same Java Object in the image

hashCode

  1. int hashCode()
Overrides:
hashCode in class java.lang.Object