Class ClassLayout


  • public class ClassLayout
    extends Object
    Handles the class data *with* the layout information.
    • Method Detail

      • parseClass

        public static ClassLayout parseClass​(Class<?> klass)
        Produce the class layout for the given class. This is a shortcut for parseClass(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 on
        layouter - 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 data
        fields - field layouts
        model - data model to use
        instanceSize - instance size
        check - 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object