Class JClass
java.lang.Object
org.matwoess.jsourceprofiler.tool.model.JClass
- All Implemented Interfaces:
Serializable,Component
This class is used to store information about a java class.
Contains information about its name, the package, the parent class and the inner classes.
It also contains a list of methods and a list of class-level blocks.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongReturns the sum of hits for all method blocks in this class and all inner classes recursively.Returns a list of all blocks in this class and all inner classes recursively.Returns a list of all inner classes recursively.Returns the full name of this class, including the package name.Returns a list of all methods in this class and all inner classes recursively.getName()Returns the name of this class, including the parent class name if it is an inner class, separated by a$.inthashCode()voidsetParentClass(JClass parentClass) Registers this class as a nested inner class of the given parent class.toString()
-
Field Details
-
name
-
classType
-
packageName
-
parentClass
-
innerClasses
-
methods
-
classBlocks
-
-
Constructor Details
-
JClass
Creates a new JClass with the given name and class type.- Parameters:
name- the name of the classtype- the class type (one ofClassType)
-
-
Method Details
-
setParentClass
Registers this class as a nested inner class of the given parent class.If the name is empty, it will be assigned a number based on the number of already registered anonymous classes.
- Parameters:
parentClass- the containing parent class
-
getName
Returns the name of this class, including the parent class name if it is an inner class, separated by a$.- Returns:
- the name of this class
-
getFullName
Returns the full name of this class, including the package name.- Returns:
- the full name of this class
-
toString
-
getClassesRecursive
Returns a list of all inner classes recursively.- Returns:
- the list of child classes
-
getMethodsRecursive
Returns a list of all methods in this class and all inner classes recursively.- Returns:
- all methods in this class and all inner classes
-
getAggregatedMethodBlockCounts
public long getAggregatedMethodBlockCounts()Returns the sum of hits for all method blocks in this class and all inner classes recursively.- Returns:
- the total number of hits for any method is this top-level class
-
getBlocksRecursive
Returns a list of all blocks in this class and all inner classes recursively.- Returns:
- the list of all blocks contained inside this class
-
equals
-
hashCode
public int hashCode()
-