Class ClassData
java.lang.Object
org.openjdk.jol.info.ClassData
Holds the class data, without the layout information.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateConstructs the empty ClassData, suited for regular class.Constructs the empty ClassData, suited for arrays. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the field data.voidaddSuperClass(String superClass) Add the super-class into the hierarchy.voidaddSuperClassData(Class superClass) Add the super-class data of the class.voidaddSuperClassData(ClassData superClassData) Add the super-class data of the class.Answer the array class for this class data.Answer the array component class for this class data.longAnswer the array length for this class data.private static intGet the class names in the hierarchy, starting from the superclasses down to subclassesbooleanfields()Get the fields' data, including all the fields in the hierarchy.Get the fields' data for the given class.inthashCode()instance()booleanisArray()Is this class data for the array?booleanDoes the class have @Contended annotation?voidMerge this class data with the super-class class dataname()Answer class nameintReturns the count of the oops in th classGet the fields' of the own fields.private static ClassDatastatic ClassDataparseClass(Class klass) Parse the existing class.static ClassDataParse the existing instance.Get ClassData of the super-class.private WeakReference<Object> wrapInstance(Object instance)
-
Field Details
-
instance
-
name
-
fields
-
classNames
-
arrayKlass
-
arrayComponentKlass
-
length
private final long length -
isArray
private final boolean isArray -
isContended
private boolean isContended -
superClass
-
-
Constructor Details
-
ClassData
Constructs the empty ClassData, suited for regular class.- Parameters:
name- class name
-
ClassData
-
ClassData
-
ClassData
-
-
Method Details
-
parseInstance
-
parseClass
-
arrayLength
-
parse
-
wrapInstance
-
addSuperClass
Add the super-class into the hierarchy.- Parameters:
superClass- super class name
-
addSuperClassData
Add the super-class data of the class.- Parameters:
superClass- super class
-
addSuperClassData
Add the super-class data of the class.- Parameters:
superClassData- parsed super class
-
addField
Add the field data.- Parameters:
fieldData- the data to add
-
fields
-
ownFields
-
oopsCount
public int oopsCount()Returns the count of the oops in th class- Returns:
- oops count
-
fieldsFor
-
classHierarchy
-
name
-
isArray
public boolean isArray()Is this class data for the array?- Returns:
- true, if class data represents the array; false otherwise
-
superClass
-
isContended
public boolean isContended()Does the class have @Contended annotation?- Returns:
- true, if class has @Contended annotation; false otherwise
-
arrayClass
Answer the array class for this class data.- Returns:
- array class name, e.g. "int[]".
-
arrayComponentType
Answer the array component class for this class data.- Returns:
- array component class name, e.g. "int" for int[] array.
-
arrayLength
public long arrayLength()Answer the array length for this class data.- Returns:
- array length
-
merge
Merge this class data with the super-class class data- Parameters:
superClassData- super class data
-
equals
-
hashCode
-
instance
- Returns:
- the recorded instance, if available
-