Package org.atpfivt.ljv.jol
Class ClassLayout
- java.lang.Object
-
- org.atpfivt.ljv.jol.ClassLayout
-
public class ClassLayout extends Object
Handles the class data *with* the layout information.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClassLayout
create(org.openjdk.jol.info.ClassData classData, SortedSet<FieldLayout> fields, org.openjdk.jol.datamodel.DataModel model, long instanceSize, boolean check)
Builds the class layout.boolean
equals(Object o)
SortedSet<FieldLayout>
fields()
Answer the set of fields, including those in superclassesint
hashCode()
static ClassLayout
parseClass(Class<?> klass)
Produce the class layout for the given class.static ClassLayout
parseClass(Class<?> klass, Layouter layouter)
Produce the class layout for the given class, and given layouter.String
toString()
-
-
-
Method Detail
-
parseClass
public static ClassLayout parseClass(Class<?> klass)
Produce the class layout for the given class. This is a shortcut forparseClass(Class, Layouter)
, but with a default layouter.- Parameters:
klass
- class to work on- Returns:
- class layout
-
parseClass
public static ClassLayout parseClass(Class<?> klass, Layouter layouter)
Produce the class layout for the given class, and given layouter. Note: You can use this method to cache the introspection results for a constant-sized objects, e.g. plain Java objects. It is not recommended to use this method on arrays, since their lengths differ from instance to instance.- Parameters:
klass
- class to work onlayouter
- class layouter- Returns:
- class layout
-
create
public static ClassLayout create(org.openjdk.jol.info.ClassData classData, SortedSet<FieldLayout> fields, org.openjdk.jol.datamodel.DataModel model, long instanceSize, boolean check)
Builds the class layout.- Parameters:
classData
- class datafields
- field layoutsmodel
- data model to useinstanceSize
- instance sizecheck
- whether to check important invariants- Returns:
- a new instance of the ClassLayout
-
fields
public SortedSet<FieldLayout> fields()
Answer the set of fields, including those in superclasses- Returns:
- sorted set of fields
-
-