|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mat.snapshot.query.PieFactory
public final class PieFactory
Helper class to create pie chart results for heap objects.
Usage:
public class PieQuery implements IQuery { @Argument public ISnapshot snapshot; public IResult execute(IProgressListener listener) throws Exception { PieFactory f = new PieFactory(snapshot); int[] topDominators = snapshot.getImmediateDominatedIds(-1); for (int ii = 0; ii < 5 && ii < topDominators.length; ii++) f.addSlice(topDominators[ii]); return f.build(); } }
Constructor Summary | |
---|---|
PieFactory(ISnapshot snapshot)
Create a pie factory for the given snapshot. |
|
PieFactory(ISnapshot snapshot,
long pieSize)
Create a pie factory for the given snapshot. |
|
PieFactory(long pieSize)
Create a pie factory for objects. |
Method Summary | |
---|---|
IResultPie.Slice |
addSlice(int objectId)
Create and add a new slice for the given object. |
IResultPie.Slice |
addSlice(int objectId,
Color color)
Create and add a new slice for the given object. |
IResultPie.Slice |
addSlice(int objectId,
String label,
long usedHeapSize,
long retainedHeapSize)
Create and add a new slice for the given object. |
IResultPie.Slice |
addSlice(int objectId,
String label,
long usedHeapSize,
long retainedHeapSize,
Color color)
Create and add a new slice for the given object. |
IResultPie.Slice |
addSlice(IObject object)
Create and add a new slice for the given object. |
IResultPie.Slice |
addSlice(IObject object,
Color color)
Create and add a new slice for the given object. |
IResultPie |
build()
Create and return the pie result object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PieFactory(ISnapshot snapshot)
SnapshotInfo.getUsedHeapSize()
.
snapshot
- public PieFactory(ISnapshot snapshot, long pieSize)
snapshot
- snapshot containing the objectspieSize
- total size of the piepublic PieFactory(long pieSize)
addSlice(IObject)
or addSlice(int, String, long, long)
methods.
pieSize
- total size of the pieMethod Detail |
---|
public IResultPie.Slice addSlice(int objectId) throws SnapshotException
To use this method, one needs to pass a ISnapshot
to the
constructor.
objectId
- object id
SnapshotException
public IResultPie.Slice addSlice(int objectId, Color color) throws SnapshotException
To use this method, one needs to pass a ISnapshot
to the
constructor.
objectId
- object idcolor
- Explicit color of the slice
SnapshotException
public IResultPie.Slice addSlice(IObject object)
object
-
public IResultPie.Slice addSlice(IObject object, Color color)
object
- color
- Explicit color of the slice
public IResultPie.Slice addSlice(int objectId, String label, long usedHeapSize, long retainedHeapSize)
objectId
- object idlabel
- (optionally) a label describing the object (for display)usedHeapSize
- (optionally) the used heap size (for display)retainedHeapSize
- the retained size which determines the size of the slice
public IResultPie.Slice addSlice(int objectId, String label, long usedHeapSize, long retainedHeapSize, Color color)
objectId
- object idlabel
- (optionally) a label describing the object (for display)usedHeapSize
- (optionally) the used heap size (for display)retainedHeapSize
- the retained size which determines the size of the slicecolor
- the color to use for the slice
public IResultPie build()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |