Package org.eclipse.mat.snapshot.model
Interface IClass
- All Superinterfaces:
IObject
,Serializable
- All Known Implementing Classes:
ClassImpl
Interface for a class instance in the heap dump.
- No Implement:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.mat.snapshot.model.IObject
IObject.Type
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.Returns all sub-classes including sub-classes of its sub-classes.long
Returns the address of the class loader which loaded this class.int
Returns the id of the class loader which loaded this class.Returns field descriptors for all member variables of instances of this class.long
Returns the heap size of one instance of this class.getName()
Returns the fully qualified class name of this class.int
Returns the number of instances of this class present in the heap dump.int[]
Ids of all instances of this class (an empty array if there are no instances of the class)long
getRetainedHeapSizeOfObjects
(boolean calculateIfNotAvailable, boolean calculateMinRetainedSize, IProgressListener listener) Returns the retained size of all objects of this instance including the class instance.Returns the static fields and it values.Returns the direct sub-classes.Returns the super class.int
Returns the id of the super class.boolean
Does the class have a super class?boolean
Test if this class an array type.Methods inherited from interface org.eclipse.mat.snapshot.model.IObject
getClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getOutboundReferences, getRetainedHeapSize, getSnapshot, getTechnicalName, getUsedHeapSize, resolveValue
-
Field Details
-
JAVA_LANG_CLASS
Name of java.lang.Class- See Also:
-
JAVA_LANG_CLASSLOADER
Name of java.lang.ClassLoader- See Also:
-
-
Method Details
-
getName
String getName()Returns the fully qualified class name of this class. The package components are separated by dots '.'. Inner classes use $ to separate the parts.- Returns:
- the name of the class
-
getNumberOfObjects
int getNumberOfObjects()Returns the number of instances of this class present in the heap dump.- Returns:
- the number of instances
-
getObjectIds
Ids of all instances of this class (an empty array if there are no instances of the class)- Returns:
- an array of all the object IDs of instances of this class
- Throws:
SnapshotException
- if there is a problem retrieving the data
-
getClassLoaderId
int getClassLoaderId()Returns the id of the class loader which loaded this class.- Returns:
- the object ID of the class loader
-
getClassLoaderAddress
long getClassLoaderAddress()Returns the address of the class loader which loaded this class.- Returns:
- the address of the class loader
-
getFieldDescriptors
List<FieldDescriptor> getFieldDescriptors()Returns field descriptors for all member variables of instances of this class. If the snapshot data format does not contain field data then this will be an empty list.- Returns:
- the field descriptors for this class
-
getStaticFields
Returns the static fields and it values. If the snapshot data format does not contain field data then this will be an empty list.- Returns:
- the static fields of this class
-
getHeapSizePerInstance
long getHeapSizePerInstance()Returns the heap size of one instance of this class. Not valid if this class represents an array.- Returns:
- the size of an instance of this class in bytes
- Since:
- 1.0
-
getRetainedHeapSizeOfObjects
long getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable, boolean calculateMinRetainedSize, IProgressListener listener) throws SnapshotException Returns the retained size of all objects of this instance including the class instance.- Parameters:
calculateIfNotAvailable
- whether to calculatecalculateMinRetainedSize
- whether an approximate calculation is sufficientlistener
- for reporting progress or for the user to cancel the calculation- Returns:
- the total retained size in bytes, negative if an approximation
- Throws:
SnapshotException
- if there is a problem
-
getSuperClassId
int getSuperClassId()Returns the id of the super class. -1 if it has no super class, i.e. if it is java.lang.Object.- Returns:
- the super class ID
-
getSuperClass
IClass getSuperClass()Returns the super class.- Returns:
- the super class
-
hasSuperClass
boolean hasSuperClass()Does the class have a super class?- Returns:
- true if the class has a super class.
-
getSubclasses
Returns the direct sub-classes.- Returns:
- a list of the immediate subclasses
-
getAllSubclasses
Returns all sub-classes including sub-classes of its sub-classes.- Returns:
- a list of all the subclasses
-
doesExtend
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.- Parameters:
className
- the candidate class name- Returns:
- true if it does extend
- Throws:
SnapshotException
- if there is a problem retrieving the information
-
isArrayType
boolean isArrayType()Test if this class an array type.- Returns:
- true if the class is an array class.
-