com.ibm.dtfj.analyzer.util
Class ObjectMarkSet

java.lang.Object
  extended by com.ibm.dtfj.analyzer.util.MarkSet
      extended by com.ibm.dtfj.analyzer.util.ObjectMarkSet

public class ObjectMarkSet
extends MarkSet

A MarkSet which operates on JavaObject items. The semantics are the same as for MarkSet but in addition we handle the concept of a mimimum allocation size (or grain). This can give greater compression of the resulting bit sets and thus lead to lower memory requirements.


Field Summary
 
Fields inherited from class com.ibm.dtfj.analyzer.util.MarkSet
DEFAULT_MAX, DEFAULT_PAGE, DEFAULT_TOP
 
Constructor Summary
ObjectMarkSet(int grain, long max)
          Build a mark set with the granularity and maximum size given.
ObjectMarkSet(ObjectMarkSet copy)
          Build a mark set as a copy of another one
 
Method Summary
 ObjectMarkSet and(ObjectMarkSet other)
          And this set with another given set and return the result.
 void clearMark(com.ibm.dtfj.java.JavaObject obj)
          Unmark the given object
 void clearMark(long id)
          Unmark the given object id
 boolean isMarked(com.ibm.dtfj.java.JavaObject obj)
          Is there a mark set for the given object ?
 boolean isMarked(long id)
          Is there a mark set for the given object id ?
 ObjectMarkSet or(ObjectMarkSet other)
          Or this set with another given set and return the result.
 void setMark(com.ibm.dtfj.java.JavaObject obj)
          Mark the given object
 void setMark(long id)
          Mark the given object id
 ObjectMarkSet xor(ObjectMarkSet other)
          Exclusive or this set with another given set and return the result.
 
Methods inherited from class com.ibm.dtfj.analyzer.util.MarkSet
and, clear, computeAnd, computeOr, computeXor, countMarks, getMaxID, or, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectMarkSet

public ObjectMarkSet(int grain,
                     long max)
Build a mark set with the granularity and maximum size given.

Parameters:
grain - the granularity of heap allocations
max - the maximum size of an object id

ObjectMarkSet

public ObjectMarkSet(ObjectMarkSet copy)
Build a mark set as a copy of another one

Parameters:
copy - the set to copy
Method Detail

setMark

public void setMark(com.ibm.dtfj.java.JavaObject obj)
Mark the given object

Parameters:
obj - the object to mark

setMark

public void setMark(long id)
Mark the given object id

Overrides:
setMark in class MarkSet
Parameters:
id - the object id

clearMark

public void clearMark(com.ibm.dtfj.java.JavaObject obj)
Unmark the given object

Parameters:
obj - the object to unmark

clearMark

public void clearMark(long id)
Unmark the given object id

Overrides:
clearMark in class MarkSet
Parameters:
id - the object id

isMarked

public boolean isMarked(com.ibm.dtfj.java.JavaObject obj)
Is there a mark set for the given object ?

Parameters:
obj - the object to test
Returns:
true if the object is marked

isMarked

public boolean isMarked(long id)
Is there a mark set for the given object id ?

Overrides:
isMarked in class MarkSet
Parameters:
id - the object id
Returns:
true if the object is marked

and

public ObjectMarkSet and(ObjectMarkSet other)
And this set with another given set and return the result. The result will have a mark if both sets have a mark.

Parameters:
other - the set to and this one with
Returns:
the resulting set - > (this & set)

or

public ObjectMarkSet or(ObjectMarkSet other)
Or this set with another given set and return the result. The result will have a mark if either set has a mark.

Parameters:
other - the set to or this one with
Returns:
the resulting set - > (this | set)

xor

public ObjectMarkSet xor(ObjectMarkSet other)
Exclusive or this set with another given set and return the result. The result will have a mark if either this set or other has a mark but not both.

Parameters:
other - the set to or this one with
Returns:
the resulting set - > (this ^ set)


© 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.