edu.wisc.cs.stego.heap
Class HeapProfile

java.lang.Object
  |
  +--edu.wisc.cs.stego.heap.HeapProfile

public class HeapProfile
extends java.lang.Object

A class for parsing and representing a snapshot of a Java heap, as represented in a JAVA PROFILE version 1.0.1. This object ignores classes from any standard package and attempts to only examine objects of classes defined for the program in question. By default, classes in packages beginning with java, sun, javax, com, and org are ignored as roots.


Field Summary
static HObject root
          This object is the symbolic root of the heap.
 
Constructor Summary
HeapProfile(java.io.File f)
          Constructs a new heap profile.
 
Method Summary
 java.util.Iterator getEntryPointNames()
          Returns an iterator over the name of the entry points to this heap.
 java.util.Iterator getEntryPoints()
          Returns an iterator over the roots of this heap.
 int getNObjects()
          Returns the number of objects in this heap.
 int getNRoots()
          Returns the number of static roots to this heap.
 java.util.Iterator getObjects()
          Returns an iterator over all of the objects in the heap.
static boolean isPrimitive(java.lang.String s)
          Given a string that is the name of a type, returns true if that type is one of the Java primitive types.
 int pruneDisconnected()
          Removes vertices which are not reachable from any root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

public static final HObject root
This object is the symbolic root of the heap.
Constructor Detail

HeapProfile

public HeapProfile(java.io.File f)
            throws java.io.IOException
Constructs a new heap profile. This constructor reads it's data from the specified file. This file is assumed to be readable by this process and of the proper format.
Method Detail

isPrimitive

public static boolean isPrimitive(java.lang.String s)
Given a string that is the name of a type, returns true if that type is one of the Java primitive types.
Parameters:
s - a string containing the name of a type.
Returns:
true if s is primitive, false otherwise.

getNRoots

public int getNRoots()
Returns the number of static roots to this heap. Roots from specified library classes are not included.
Returns:
the number of static roots to this heap.

getNObjects

public int getNObjects()
Returns the number of objects in this heap.
Returns:
the number of objects in this heap.

getEntryPointNames

public java.util.Iterator getEntryPointNames()
Returns an iterator over the name of the entry points to this heap. The iterator contains String objects.

getEntryPoints

public java.util.Iterator getEntryPoints()
Returns an iterator over the roots of this heap. The iterator will contain HVertex objects.
Returns:
an iterator over the roots of this heap.

getObjects

public java.util.Iterator getObjects()
Returns an iterator over all of the objects in the heap.
Returns:
an iterator over all of the objects in the heap.

pruneDisconnected

public int pruneDisconnected()
Removes vertices which are not reachable from any root.