org.eclipse.mat.snapshot
Class MultiplePathsFromGCRootsClassRecord

java.lang.Object
  extended by org.eclipse.mat.snapshot.MultiplePathsFromGCRootsClassRecord

public class MultiplePathsFromGCRootsClassRecord
extends java.lang.Object

Holds one level of multiple paths from Garbage Collection roots merged by class.


Constructor Summary
MultiplePathsFromGCRootsClassRecord(IClass clazz, int level, boolean fromRoots, ISnapshot snapshot)
          Constructor
 
Method Summary
 void addPath(int[] path)
          This method is used only when the record is built.
 IClass getClazz()
           
static java.util.Comparator<MultiplePathsFromGCRootsClassRecord> getComparatorByNumberOfReferencedObjects()
           
static java.util.Comparator<MultiplePathsFromGCRootsClassRecord> getComparatorByReferencedHeapSize()
          Returns a Comparator ordering the records descending by the total size of referenced objects.
 int getCount()
          Get the number of paths going through this object
 int getDistinctCount()
          Get the number of distinct objects of this class
 int getLevel()
           
 java.util.List<int[]> getPaths()
          Get all the paths going through the object (getObjectId())
 long getReferencedHeapSize()
          Get the total net heap size of all referenced objects (see getReferencedObjects())
 int[] getReferencedObjects()
          Get the "end" objects for each path.
 boolean isFromRoots()
           
 MultiplePathsFromGCRootsClassRecord[] nextLevel()
          Go down to the next level
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplePathsFromGCRootsClassRecord

public MultiplePathsFromGCRootsClassRecord(IClass clazz,
                                           int level,
                                           boolean fromRoots,
                                           ISnapshot snapshot)
Constructor

Parameters:
clazz - the class in question
level -
fromRoots - true means from roots, false means to roots
snapshot -
Method Detail

nextLevel

public MultiplePathsFromGCRootsClassRecord[] nextLevel()
                                                throws SnapshotException
Go down to the next level

Returns:
an array of records from the next level
Throws:
SnapshotException

addPath

public void addPath(int[] path)
This method is used only when the record is built. Adds one path to the set of paths

Parameters:
path -

getPaths

public java.util.List<int[]> getPaths()
Get all the paths going through the object (getObjectId())

Returns:
List<int[]> each element in the list is an int[] representing a path

getCount

public int getCount()
Get the number of paths going through this object


getDistinctCount

public int getDistinctCount()
Get the number of distinct objects of this class


getReferencedHeapSize

public long getReferencedHeapSize()
                           throws SnapshotException
Get the total net heap size of all referenced objects (see getReferencedObjects())

Returns:
- the total heap size of all referenced objects
Throws:
SnapshotException

getReferencedObjects

public int[] getReferencedObjects()
Get the "end" objects for each path. This is equal to getting all the paths and looking at their element [0]

Returns:
- an array with all the objects at the end of the paths

getComparatorByNumberOfReferencedObjects

public static java.util.Comparator<MultiplePathsFromGCRootsClassRecord> getComparatorByNumberOfReferencedObjects()

getComparatorByReferencedHeapSize

public static java.util.Comparator<MultiplePathsFromGCRootsClassRecord> getComparatorByReferencedHeapSize()
Returns a Comparator ordering the records descending by the total size of referenced objects.


getClazz

public IClass getClazz()

isFromRoots

public boolean isFromRoots()

getLevel

public int getLevel()