Package org.openjdk.jmc.common.util
Class MCOldObject
- java.lang.Object
-
- org.openjdk.jmc.common.util.MCOldObject
-
- All Implemented Interfaces:
IMCOldObject
public class MCOldObject extends java.lang.Object implements IMCOldObject
Base implementation of theIMCOldObject
interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MCOldObject.MCOldObjectArray
private static class
MCOldObject.MCOldObjectField
-
Field Summary
Fields Modifier and Type Field Description private IQuantity
address
private MCOldObject.MCOldObjectArray
array
private MCOldObject.MCOldObjectField
field
private java.lang.String
objectDescription
private IMCOldObject
referrer
private IMCType
type
-
Constructor Summary
Constructors Constructor Description MCOldObject(IQuantity address, IMCType type, java.lang.String objectDescription, IMCOldObject referrer, java.lang.String field, IQuantity fieldModifier, IQuantity arraySize, IQuantity arrayIndex)
Create a new old object instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
IQuantity
getAddress()
The address of the object, used for identity purposes.java.lang.String
getDescription()
Returns a description of the object.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 returnsnull
.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.IMCType
getType()
The type of the object, as anIMCType
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
address
private final IQuantity address
-
array
private final MCOldObject.MCOldObjectArray array
-
field
private final MCOldObject.MCOldObjectField field
-
objectDescription
private final java.lang.String objectDescription
-
referrer
private final IMCOldObject referrer
-
type
private final IMCType type
-
-
Constructor Detail
-
MCOldObject
public MCOldObject(IQuantity address, IMCType type, java.lang.String objectDescription, IMCOldObject referrer, java.lang.String field, IQuantity fieldModifier, IQuantity arraySize, IQuantity arrayIndex)
Create a new old object instance.- Parameters:
address
- object address, seeIMCOldObject.getAddress()
type
- object typeobjectDescription
- object descriptionreferrer
- Referrer object, seeIMCOldObject.getReferrer()
.null
if there is no referring object.field
- Name of the referring field, seeIMCOldObjectField.getName()
.null
if there is no referring field.fieldModifier
- Modifier of the referring field, seeIMCOldObjectField.getModifier()
.null
if there is no referring field.arraySize
- The array size iffield
refers to an array, seeIMCOldObjectArray.getSize()
.null
if the field is not an array.arrayIndex
- The array index that refers to this object iffield
refers to an array, seeIMCOldObjectArray.getIndex()
.null
if the field is not an array.
-
-
Method Detail
-
getAddress
public IQuantity getAddress()
Description copied from interface:IMCOldObject
The address of the object, used for identity purposes.- Specified by:
getAddress
in interfaceIMCOldObject
- Returns:
- the address of the object
-
getReferrerArray
public IMCOldObjectArray getReferrerArray()
Description copied from interface:IMCOldObject
If the object is referred to by an object in an array it returns the information about that array, otherwise it returnsnull
.- Specified by:
getReferrerArray
in interfaceIMCOldObject
- Returns:
- a representation of the array data for the object referring to this old object
-
getReferrerField
public IMCOldObjectField getReferrerField()
Description copied from interface:IMCOldObject
If the object is referred to by an object in a field it returns a representation of the field,null
otherwise.- Specified by:
getReferrerField
in interfaceIMCOldObject
- Returns:
- a representation of the field that refers to this object
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IMCOldObject
Returns a description of the object.- Specified by:
getDescription
in interfaceIMCOldObject
- Returns:
- the object description
-
getReferrer
public IMCOldObject getReferrer()
Description copied from interface:IMCOldObject
Returns the object that refers to this object in the heap reference chain.- Specified by:
getReferrer
in interfaceIMCOldObject
- Returns:
- the object that refers to this object
-
getType
public IMCType getType()
Description copied from interface:IMCOldObject
The type of the object, as anIMCType
- Specified by:
getType
in interfaceIMCOldObject
- Returns:
- the type of the object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getReferrerSkip
public int getReferrerSkip()
Description copied from interface:IMCOldObject
Returns the number of steps away in the reference chain this object is from the next object referring to it. If this is greater than 0, it means that there are objects between this one and the referrer that were omitted when committing the traces to the Flight Recording file.- Specified by:
getReferrerSkip
in interfaceIMCOldObject
- Returns:
- the number of steps between this object and the next one towards the root in the reference chain
-
-