com.ibm.dtfj.analyzer.util
Class ObjectIDFactory

java.lang.Object
  extended by com.ibm.dtfj.analyzer.util.ObjectIDFactory

public class ObjectIDFactory
extends java.lang.Object

A factory class to build object IDs from addresses. The aim is to build the smallest IDs possible by subtracting the lowest possible address and then dividing by the object allocation boundary size. We also record a boolean property that gives a hint to other classes that it may be possible to represent object IDs as ints rather than longs which may significantly reduce the size of cross reference chains etc.


Constructor Summary
ObjectIDFactory(long minAddr, int grain, boolean intAddressing)
          Build a new factory given the lowest possible address, heap grain and a flag to specify that integer addressing is possible.
 
Method Summary
 long getObjectID(com.ibm.dtfj.java.JavaObject obj)
          Convert from an object to an ID
 long getObjectID(long addr)
          Convert from an address to an object ID
 boolean isIntAddressing()
          Is integer addressing possible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectIDFactory

public ObjectIDFactory(long minAddr,
                       int grain,
                       boolean intAddressing)
Build a new factory given the lowest possible address, heap grain and a flag to specify that integer addressing is possible.

Parameters:
minAddr - lowest possible address
grain - object allocation boundary
intAddressing - is integer addressing possible
Method Detail

getObjectID

public long getObjectID(com.ibm.dtfj.java.JavaObject obj)
Convert from an object to an ID

Parameters:
obj - the object
Returns:
the ID

getObjectID

public long getObjectID(long addr)
Convert from an address to an object ID

Parameters:
addr - the address
Returns:
the ID

isIntAddressing

public boolean isIntAddressing()
Is integer addressing possible

Returns:
true if integer addressing is possible


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.