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, toStringgetClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, resolveValuepublic 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
IClassgetObjectIds in interface IClassUnsupportedOperationExceptionSnapshotExceptionpublic long getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable,
boolean approximation,
IProgressListener listener)
throws SnapshotException
IClassgetRetainedHeapSizeOfObjects in interface IClassSnapshotExceptionpublic long getUsedHeapSize()
IObjectgetUsedHeapSize in interface IObjectgetUsedHeapSize in class AbstractObjectImplpublic ArrayLong getReferences()
AbstractObjectImplgetReferences in class AbstractObjectImplpublic List<NamedReference> getOutboundReferences()
IObjectgetOutboundReferences in interface IObjectpublic long getClassLoaderAddress()
IClassgetClassLoaderAddress in interface IClasspublic void setClassLoaderAddress(long address)
public List<FieldDescriptor> getFieldDescriptors()
IClassgetFieldDescriptors in interface IClasspublic int getNumberOfObjects()
IClassgetNumberOfObjects in interface IClasspublic long getHeapSizePerInstance()
IClassgetHeapSizePerInstance in interface IClasspublic void setHeapSizePerInstance(long size)
public String getName()
IClasspublic void setName(String name)
public List<Field> getStaticFields()
IClassgetStaticFields in interface IClasspublic long getSuperClassAddress()
public int getSuperClassId()
IClassgetSuperClassId in interface IClasspublic ClassImpl getSuperClass()
IClassgetSuperClass in interface IClasspublic long getTotalSize()
public boolean hasSuperClass()
IClasshasSuperClass in interface IClasspublic int compareTo(ClassImpl other)
compareTo in interface Comparable<ClassImpl>public void addInstance(long usedHeapSize)
public void removeInstance(long heapSizePerInstance)
public List<IClass> getSubclasses()
IClassgetSubclasses in interface IClasspublic List<IClass> getAllSubclasses()
IClassgetAllSubclasses in interface IClasspublic boolean isArrayType()
IClassisArrayType in interface IClasspublic String getTechnicalName()
IObjectgetTechnicalName in interface IObjectgetTechnicalName in class AbstractObjectImplpublic int getClassLoaderId()
IClassgetClassLoaderId in interface IClasspublic void addSubClass(ClassImpl clazz)
public void removeSubClass(ClassImpl clazz)
public void setUsedHeapSize(long usedHeapSize)
public boolean doesExtend(String className) throws SnapshotException
IClassdoesExtend in interface IClassSnapshotExceptionpublic void setSnapshot(ISnapshot dump)
AbstractObjectImplsetSnapshot in class AbstractObjectImpldump - the actual current snapshot