Interface IClass

  • All Superinterfaces:
    IObject, java.io.Serializable
    All Known Implementing Classes:
    ClassImpl

    public interface IClass
    extends IObject
    Interface for a class instance in the heap dump.
    No Implement:
    • Field Detail

      • JAVA_LANG_CLASS

        static final java.lang.String JAVA_LANG_CLASS
        Name of java.lang.Class
        See Also:
        Constant Field Values
      • JAVA_LANG_CLASSLOADER

        static final java.lang.String JAVA_LANG_CLASSLOADER
        Name of java.lang.ClassLoader
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        java.lang.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

        int[] getObjectIds()
                    throws SnapshotException
        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

        java.util.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

        java.util.List<Field> 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 calculate
        calculateMinRetainedSize - whether an approximate calculation is sufficient
        listener - 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

        java.util.List<IClass> getSubclasses()
        Returns the direct sub-classes.
        Returns:
        a list of the immediate subclasses
      • getAllSubclasses

        java.util.List<IClass> getAllSubclasses()
        Returns all sub-classes including sub-classes of its sub-classes.
        Returns:
        a list of all the subclasses
      • doesExtend

        boolean doesExtend​(java.lang.String className)
                    throws SnapshotException
        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.