public class ReferenceTreeObject extends java.lang.Object implements IMCOldObject, IDisplayable
ReferenceTreeModel
.Modifier and Type | Class and Description |
---|---|
static class |
ReferenceTreeObject.ReferenceTreeObjectType |
Modifier and Type | Field and Description |
---|---|
private java.util.List<ReferenceTreeObject> |
children |
private int |
distanceFromRoot |
static int |
FORMAT_ARRAY_INFO |
static int |
FORMAT_FIELD |
static int |
FORMAT_OTHER_MODIFIERS |
static int |
FORMAT_PACKAGE |
static int |
FORMAT_STATIC_MODIFIER |
private java.util.Set<IItem> |
items |
private double |
leakRelevance |
private IMCOldObject |
object |
private int |
objectsKeptAliveCount |
private java.util.Map<IQuantity,ReferenceTreeObject> |
oldObjectSamples |
private ReferenceTreeObject |
parent |
private java.lang.String |
rootDescription |
private IQuantity |
timestamp |
AUTO, EXACT, VERBOSE
Constructor and Description |
---|
ReferenceTreeObject(IQuantity timestamp,
IMCOldObject object) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addChild(ReferenceTreeObject node) |
(package private) void |
addItem(IItem item) |
(package private) void |
addRoot(IMCOldObjectGcRoot root) |
java.lang.String |
displayUsing(java.lang.String hint)
Format this object for display purposes, preferably using the formatter hinted by
formatHint . |
boolean |
equals(java.lang.Object o) |
IQuantity |
getAddress()
The address of the object, used for identity purposes.
|
IMCOldObjectArray |
getArray() |
java.util.List<ReferenceTreeObject> |
getChildren() |
java.lang.String |
getDescription()
Returns a description of the object.
|
int |
getDistanceFromRoot() |
IMCOldObjectField |
getField() |
java.util.Set<IItem> |
getItems()
This method is used when it is necessary to get information about all objects this object
keeps alive in the
ReferenceTreeModel . |
double |
getLeakRelevance() |
int |
getObjectsKeptAliveCount() |
java.util.Map<IQuantity,ReferenceTreeObject> |
getOldObjectSamples() |
ReferenceTreeObject |
getParent()
This method returns an object that is keeping this object alive.
|
IMCOldObject |
getReferrer()
Returns the object that refers to this object in the heap reference chain.
|
IMCOldObjectArray |
getReferrerArray()
If the object is referred to by an object in an array it returns the information about that
array, otherwise it returns
null . |
IMCOldObjectField |
getReferrerField()
If the object is referred to by an object in a field it returns a representation of the
field,
null otherwise. |
int |
getReferrerSkip()
Returns the number of steps away in the reference chain this object is from the next object
referring to it.
|
java.lang.String |
getRootDescription() |
ReferenceTreeObject |
getRootObject() |
IQuantity |
getTimestamp() |
IMCType |
getType()
The type of the object, as an
IMCType |
int |
hashCode() |
(package private) void |
incrementObjectsKeptAliveCount()
Increments the number of objects this object keeps alive.
|
(package private) void |
setDistanceFromRoot(int distance) |
(package private) void |
setLeakRelevance(double relevance) |
void |
setParent(ReferenceTreeObject parent) |
java.lang.String |
toString(int displayFormatting)
Returns a string representation of this object.
|
void |
updateOldObjectSamples(ReferenceTreeObject oldobjectrefnode)
This method updates the Root object's Map with allocationTime and its oldObjectReference
object (leaves).
|
private final java.util.List<ReferenceTreeObject> children
private final java.util.Set<IItem> items
private final java.util.Map<IQuantity,ReferenceTreeObject> oldObjectSamples
private java.lang.String rootDescription
private IMCOldObject object
private int objectsKeptAliveCount
private ReferenceTreeObject parent
private IQuantity timestamp
private double leakRelevance
private int distanceFromRoot
public static final int FORMAT_PACKAGE
public static final int FORMAT_FIELD
public static final int FORMAT_STATIC_MODIFIER
public static final int FORMAT_OTHER_MODIFIERS
public static final int FORMAT_ARRAY_INFO
ReferenceTreeObject(IQuantity timestamp, IMCOldObject object)
timestamp
- a timestamp representing when the object was allocatedobject
- the object itselfvoid setDistanceFromRoot(int distance)
distance
- the distance from the root objectpublic int getDistanceFromRoot()
void setLeakRelevance(double relevance)
relevance
- how relevant this object is as a leak candidatepublic double getLeakRelevance()
void addChild(ReferenceTreeObject node)
node
- a child to be added to this objectvoid addItem(IItem item)
item
- an item this object keeps alivepublic java.util.Set<IItem> getItems()
ReferenceTreeModel
. E.g. the Mission Control GUI uses this when a
user selects a row in the tree to show everything below it as well in the properties view.IItem
objects this object keeps alive, including
itselfvoid addRoot(IMCOldObjectGcRoot root)
root
- a GC root descriptionpublic java.lang.String getRootDescription()
public IQuantity getAddress()
IMCOldObject
getAddress
in interface IMCOldObject
public IMCOldObjectArray getReferrerArray()
IMCOldObject
null
.getReferrerArray
in interface IMCOldObject
public IMCOldObjectArray getArray()
null
otherwisepublic java.util.List<ReferenceTreeObject> getChildren()
public IMCOldObjectField getReferrerField()
IMCOldObject
null
otherwise.getReferrerField
in interface IMCOldObject
public IMCOldObjectField getField()
null
otherwisepublic java.lang.String getDescription()
IMCOldObject
getDescription
in interface IMCOldObject
public int getObjectsKeptAliveCount()
public ReferenceTreeObject getParent()
public IMCOldObject getReferrer()
IMCOldObject
getReferrer
in interface IMCOldObject
public IQuantity getTimestamp()
public IMCType getType()
IMCOldObject
IMCType
getType
in interface IMCOldObject
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
void incrementObjectsKeptAliveCount()
public void setParent(ReferenceTreeObject parent)
parent
- the parent of this objectpublic ReferenceTreeObject getRootObject()
public int getReferrerSkip()
IMCOldObject
getReferrerSkip
in interface IMCOldObject
public java.util.Map<IQuantity,ReferenceTreeObject> getOldObjectSamples()
public void updateOldObjectSamples(ReferenceTreeObject oldobjectrefnode)
oldobjectrefnode
- oldObjectReference leaf nodepublic java.lang.String displayUsing(java.lang.String hint)
IDisplayable
formatHint
. If no such formatter is defined for this type, the default formatter will
be used.displayUsing
in interface IDisplayable
hint
- the format hintpublic java.lang.String toString(int displayFormatting)
displayFormatting
- an int describing how this object is to be represented, using bitwise masking of
constants defined in ReferenceTreeObject