|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mat.parser.model.AbstractObjectImpl
org.eclipse.mat.parser.model.ClassImpl
public class ClassImpl
Implementation of a Java object representing a java.lang.Class object. As well as some standard object information it contains information about the class and summary details about instances of this class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.mat.snapshot.model.IObject |
|---|
IObject.Type |
| Field Summary | |
|---|---|
static String |
JAVA_LANG_CLASS
|
| Fields inherited from interface org.eclipse.mat.snapshot.model.IClass |
|---|
JAVA_LANG_CLASSLOADER |
| Constructor Summary | |
|---|---|
ClassImpl(long address,
String name,
long superId,
long loaderId,
Field[] staticFields,
FieldDescriptor[] fields)
Construct a class object based on name, address and fields. |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.eclipse.mat.parser.model.AbstractObjectImpl |
|---|
equals, getClassAddress, getClassId, getClassSpecificName, getClazz, getComparatorForClassSpecificName, getComparatorForTechnicalName, getComparatorForUsedHeapSize, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, hashCode, resolveValue, setClassInstance, setObjectAddress, setObjectId, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.mat.snapshot.model.IObject |
|---|
getClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, resolveValue |
| Field Detail |
|---|
public static final String JAVA_LANG_CLASS
| Constructor Detail |
|---|
public ClassImpl(long address,
String name,
long superId,
long loaderId,
Field[] staticFields,
FieldDescriptor[] fields)
address - the address of the class objectname - the class name, using '.' as package separatorsuperId - the id of the superclass, or -1 if none.loaderId - the id of the class loaderstaticFields - all the static fields, with valuesfields - all the instance fields as descriptors| Method Detail |
|---|
public 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 index
public int[] getObjectIds()
throws UnsupportedOperationException,
SnapshotException
IClass
getObjectIds in interface IClassUnsupportedOperationException
SnapshotException
public long getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable,
boolean approximation,
IProgressListener listener)
throws SnapshotException
IClass
getRetainedHeapSizeOfObjects in interface IClassSnapshotExceptionpublic long getUsedHeapSize()
IObject
getUsedHeapSize in interface IObjectgetUsedHeapSize in class AbstractObjectImplpublic ArrayLong getReferences()
AbstractObjectImpl
getReferences in class AbstractObjectImplpublic List<NamedReference> getOutboundReferences()
IObject
getOutboundReferences in interface IObjectpublic long getClassLoaderAddress()
IClass
getClassLoaderAddress in interface IClasspublic void setClassLoaderAddress(long address)
public List<FieldDescriptor> getFieldDescriptors()
IClass
getFieldDescriptors in interface IClasspublic int getNumberOfObjects()
IClass
getNumberOfObjects in interface IClasspublic long getHeapSizePerInstance()
IClass
getHeapSizePerInstance in interface IClasspublic void setHeapSizePerInstance(long size)
public String getName()
IClass
getName in interface IClasspublic void setName(String name)
public List<Field> getStaticFields()
IClass
getStaticFields in interface IClasspublic long getSuperClassAddress()
public int getSuperClassId()
IClass
getSuperClassId in interface IClasspublic ClassImpl getSuperClass()
IClass
getSuperClass in interface IClasspublic long getTotalSize()
public boolean hasSuperClass()
IClass
hasSuperClass 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()
IClass
getSubclasses in interface IClasspublic List<IClass> getAllSubclasses()
IClass
getAllSubclasses in interface IClasspublic boolean isArrayType()
IClass
isArrayType in interface IClasspublic String getTechnicalName()
IObject
getTechnicalName in interface IObjectgetTechnicalName in class AbstractObjectImplpublic int getClassLoaderId()
IClass
getClassLoaderId in interface IClasspublic 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 IClassSnapshotExceptionpublic void setSnapshot(ISnapshot dump)
AbstractObjectImpl
setSnapshot in class AbstractObjectImpldump - the actual current snapshot
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||