Class ObjectReference

java.lang.Object
org.eclipse.mat.snapshot.model.ObjectReference
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NamedReference

public class ObjectReference extends Object implements Serializable
The value of a field if it is an object reference. Also can be used to retrieve an IObject from its address even if the object has not been indexed provided that the snapshot parser supports the reading of unindexed or discarded objects.
See Also:
  • Constructor Details

    • ObjectReference

      public ObjectReference(ISnapshot snapshot, long address)
      Create a reference to an object based on its address but in a form where the object id can be found.
      Parameters:
      snapshot - the snapshot
      address - the address of the object
  • Method Details

    • getObjectAddress

      public long getObjectAddress()
      The actual address of the object
      Returns:
      the address
    • getObjectId

      public int getObjectId() throws SnapshotException
      The id of the object
      Returns:
      the object id
      Throws:
      SnapshotException - if the object has not been indexed, for example if it is unreachable or has been discarded.
    • getObject

      public IObject getObject() throws SnapshotException
      Get a detailed view of the object. Can be used to find an unindexed object by its addresss if the snapshot parser supports that.
      Returns:
      the object detail
      Throws:
      SnapshotException - if there is a problem retrieving the object
    • toString

      public String toString()
      A simple view of the object as an address
      Overrides:
      toString in class Object
      Returns:
      the object address as a hexadecimal number.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object