public class ClassImpl extends AbstractObjectImpl implements IClass, Comparable<ClassImpl>
IObject.Type
Modifier and Type | Field and Description |
---|---|
static String |
JAVA_LANG_CLASS |
JAVA_LANG_CLASSLOADER
Constructor and Description |
---|
ClassImpl(long address,
String name,
long superAddress,
long loaderAddress,
Field[] staticFields,
FieldDescriptor[] fields)
Construct a class object based on name, address and fields.
|
Modifier and Type | Method and Description |
---|---|
void |
addInstance(long usedHeapSize) |
void |
addSubClass(ClassImpl clazz) |
int |
compareTo(ClassImpl other) |
boolean |
doesExtend(String className)
Does this class extend a class of the supplied name?
With multiple class loaders the supplied name might not
be the class you were intending to find.
|
List<IClass> |
getAllSubclasses()
Returns all sub-classes including sub-classes of its sub-classes.
|
Serializable |
getCacheEntry()
Gets the key for extra information about this class.
|
long |
getClassLoaderAddress()
Returns the address of the class loader which loaded this class.
|
int |
getClassLoaderId()
Returns the id of the class loader which loaded this class.
|
List<FieldDescriptor> |
getFieldDescriptors()
Returns field descriptors for all member variables of instances of this
class.
|
long |
getHeapSizePerInstance()
Returns the heap size of one instance of this class.
|
String |
getName()
Returns the fully qualified class name of this class.
|
int |
getNumberOfObjects()
Returns the number of instances of this class present in the heap dump.
|
int[] |
getObjectIds()
Ids of all instances of this class (an empty array if there are no instances of the class)
|
List<NamedReference> |
getOutboundReferences()
Get list of snapshot objects referenced from this snapshot object with
the name of the field over which it was referenced.
|
ArrayLong |
getReferences()
Gets the outbound references from this object, as addresses.
|
long |
getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable,
boolean approximation,
IProgressListener listener)
Returns the retained size of all objects of this instance including the
class instance.
|
List<Field> |
getStaticFields()
Returns the static fields and it values.
|
List<IClass> |
getSubclasses()
Returns the direct sub-classes.
|
ClassImpl |
getSuperClass()
Returns the super class.
|
long |
getSuperClassAddress() |
int |
getSuperClassId()
Returns the id of the super class.
|
String |
getTechnicalName()
Get technical name of this object which is something like class@address.
|
long |
getTotalSize() |
long |
getUsedHeapSize()
Get used heap size of just this object.
|
boolean |
hasSuperClass()
Returns true if the class has a super class.
|
boolean |
isArrayType()
Returns true if the class is an array class.
|
void |
removeInstance(long heapSizePerInstance) |
void |
removeSubClass(ClassImpl clazz) |
void |
setCacheEntry(Serializable cacheEntry)
Sets the key for extra information about this class.
|
void |
setClassLoaderAddress(long address) |
void |
setClassLoaderIndex(int classLoaderIndex)
Sets the class loader index.
|
void |
setHeapSizePerInstance(long size) |
void |
setName(String name) |
void |
setSnapshot(ISnapshot dump)
Set the snapshot for an object.
|
void |
setSuperClassIndex(int superClassIndex)
Sets the superclass index.
|
void |
setUsedHeapSize(long usedHeapSize) |
equals, getClassAddress, getClassId, getClassSpecificName, getClazz, getComparatorForClassSpecificName, getComparatorForTechnicalName, getComparatorForUsedHeapSize, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, hashCode, resolveValue, setClassInstance, setObjectAddress, setObjectId, toString
getClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, resolveValue
public static final String JAVA_LANG_CLASS
public ClassImpl(long address, String name, long superAddress, long loaderAddress, Field[] staticFields, FieldDescriptor[] fields)
address
- the address of the class objectname
- the class name, using '.' as package separatorsuperAddress
- the address of the superclass, or 0 if none.loaderAddress
- the address of the class loaderstaticFields
- all the static fields, with valuesfields
- all the instance fields as descriptorspublic Serializable getCacheEntry()
public void setCacheEntry(Serializable cacheEntry)
cacheEntry
- the keypublic void setSuperClassIndex(int superClassIndex)
superClassIndex
- the new indexpublic void setClassLoaderIndex(int classLoaderIndex)
classLoaderIndex
- the new indexpublic int[] getObjectIds() throws UnsupportedOperationException, SnapshotException
IClass
getObjectIds
in interface IClass
UnsupportedOperationException
SnapshotException
public long getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable, boolean approximation, IProgressListener listener) throws SnapshotException
IClass
getRetainedHeapSizeOfObjects
in interface IClass
SnapshotException
public long getUsedHeapSize()
IObject
getUsedHeapSize
in interface IObject
getUsedHeapSize
in class AbstractObjectImpl
public ArrayLong getReferences()
AbstractObjectImpl
getReferences
in class AbstractObjectImpl
public List<NamedReference> getOutboundReferences()
IObject
getOutboundReferences
in interface IObject
public long getClassLoaderAddress()
IClass
getClassLoaderAddress
in interface IClass
public void setClassLoaderAddress(long address)
public List<FieldDescriptor> getFieldDescriptors()
IClass
getFieldDescriptors
in interface IClass
public int getNumberOfObjects()
IClass
getNumberOfObjects
in interface IClass
public long getHeapSizePerInstance()
IClass
getHeapSizePerInstance
in interface IClass
public void setHeapSizePerInstance(long size)
public String getName()
IClass
public void setName(String name)
public List<Field> getStaticFields()
IClass
getStaticFields
in interface IClass
public long getSuperClassAddress()
public int getSuperClassId()
IClass
getSuperClassId
in interface IClass
public ClassImpl getSuperClass()
IClass
getSuperClass
in interface IClass
public long getTotalSize()
public boolean hasSuperClass()
IClass
hasSuperClass
in interface IClass
public int compareTo(ClassImpl other)
compareTo
in interface Comparable<ClassImpl>
public void addInstance(long usedHeapSize)
public void removeInstance(long heapSizePerInstance)
public List<IClass> getSubclasses()
IClass
getSubclasses
in interface IClass
public List<IClass> getAllSubclasses()
IClass
getAllSubclasses
in interface IClass
public boolean isArrayType()
IClass
isArrayType
in interface IClass
public String getTechnicalName()
IObject
getTechnicalName
in interface IObject
getTechnicalName
in class AbstractObjectImpl
public int getClassLoaderId()
IClass
getClassLoaderId
in interface IClass
public void addSubClass(ClassImpl clazz)
public void removeSubClass(ClassImpl clazz)
public void setUsedHeapSize(long usedHeapSize)
public boolean doesExtend(String className) throws SnapshotException
IClass
doesExtend
in interface IClass
SnapshotException
public void setSnapshot(ISnapshot dump)
AbstractObjectImpl
setSnapshot
in class AbstractObjectImpl
dump
- the actual current snapshot