Package org.eclipse.mat.snapshot

# Class ClassHistogramRecord

java.lang.Object
org.eclipse.mat.snapshot.HistogramRecord
org.eclipse.mat.snapshot.ClassHistogramRecord

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `XClassHistogramRecord`

public class ClassHistogramRecord extends HistogramRecord
This class holds the histogram data on the objects found in the object set for which a histogram was computed (aggregated per class).

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.eclipse.mat.snapshot.HistogramRecord

`COMPARATOR_FOR_LABEL, COMPARATOR_FOR_NUMBEROFOBJECTS, COMPARATOR_FOR_RETAINEDHEAPSIZE, COMPARATOR_FOR_USEDHEAPSIZE`

## Constructor Summary

Constructors
Constructor
Description
`ClassHistogramRecord(String label, int classId, int[] objectIds, long usedHeapSize, long retainedHeapSize)`
Build a histogram record
`ClassHistogramRecord(String label, int classId, long numberOfObjects, long usedHeapSize, long retainedHeapSize)`
Build a histogram record

## Method Summary

Modifier and Type
Method
Description
`long`
`calculateRetainedSize(ISnapshot snapshot, boolean calculateIfNotAvailable, boolean approximation, IProgressListener listener)`
Find out the retained size
`int`
`getClassId()`
Get id of the class this class histogram record stands for.
`int[]`
`getObjectIds()`
Get ids of the objects this class histogram record stands for.
`String`
`toString()`

### Methods inherited from class org.eclipse.mat.snapshot.HistogramRecord

`getLabel, getNumberOfObjects, getRetainedHeapSize, getUsedHeapSize, incNumberOfObjects, incNumberOfObjects, incRetainedHeapSize, incUsedHeapSize, reverseComparator, setLabel, setNumberOfObjects, setRetainedHeapSize, setUsedHeapSize`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ClassHistogramRecord

public ClassHistogramRecord(String label, int classId, long numberOfObjects, long usedHeapSize, long retainedHeapSize)
Build a histogram record

Parameters:
  `label` - the class name
  `classId` - the id of the class
  `numberOfObjects` - the number of objects of that class
  `usedHeapSize` - the space used by those objects
  `retainedHeapSize` - the total of the size of all the objects retained by those objects. 0 means calculate when required, negative means approximate size, positive means exact retained size is known.

### ClassHistogramRecord

public ClassHistogramRecord(String label, int classId, int[] objectIds, long usedHeapSize, long retainedHeapSize)
Build a histogram record

Parameters:
  `label` - the class name
  `classId` - the id of the class
  `objectIds` - the ids of objects of that class
  `usedHeapSize` - the space used by those objects
  `retainedHeapSize` - the total of the size of all the objects retained by those objects. 0 means calculate when required, negative means approximate size, positive means exact retained size is known.

## Method Details

### getClassId

public int getClassId()
Get id of the class this class histogram record stands for.

Returns:
  id of the class this class histogram record stands for

### getObjectIds

public int[] getObjectIds()
Get ids of the objects this class histogram record stands for.

Returns:
  ids of the objects this class histogram record stands for

### calculateRetainedSize

public long calculateRetainedSize(ISnapshot snapshot, boolean calculateIfNotAvailable, boolean approximation, IProgressListener listener) throws SnapshotException
Find out the retained size

Parameters:
  `snapshot` - the snapshot
  `calculateIfNotAvailable` - whether to calculate the size if not already available
  `approximation` - whether to use an approximation to the retained size (sum of the individual retained sizes)
  `listener` - to report progress and errors
Returns:
  the retained size, negated if approximate, 0 if not available
Throws:
  `SnapshotException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`