org.openjdk.jol.info
Class ClassLayout

java.lang.Object
  extended by org.openjdk.jol.info.ClassLayout

public class ClassLayout
extends Object

Handles the class data *with* the layout information.


Constructor Summary
ClassLayout(ClassData classData, SortedSet<FieldLayout> fields, int headerSize, int instanceSize, boolean check)
          Builds the class layout.
 
Method Summary
 SortedSet<FieldLayout> fields()
          Answer the set of fields, including those in superclasses
 int headerSize()
          Answer header size
 int instanceSize()
          Answer instance size
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 toPrintable()
          Produce printable stringly representation of class layout.
 String toPrintable(Object instance)
          Produce printable stringly representation of class layout.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassLayout

public ClassLayout(ClassData classData,
                   SortedSet<FieldLayout> fields,
                   int headerSize,
                   int instanceSize,
                   boolean check)
Builds the class layout.

Parameters:
classData - class data
fields - field layouts
headerSize - header size
instanceSize - instance size
check - whether to check important invariants
Method Detail

parseClass

public static ClassLayout parseClass(Class<?> klass)
Produce the class layout for the given class. This produces the layout for the current VM.

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.

Parameters:
klass - class to work on
layouter - class layouter
Returns:
class layout

fields

public SortedSet<FieldLayout> fields()
Answer the set of fields, including those in superclasses

Returns:
sorted set of fields

instanceSize

public int instanceSize()
Answer instance size

Returns:
instance size

headerSize

public int headerSize()
Answer header size

Returns:
header size

toString

public String toString()
Overrides:
toString in class Object

toPrintable

public String toPrintable()
Produce printable stringly representation of class layout. This method does not require alive instance, just the class.

Returns:
human-readable layout info

toPrintable

public String toPrintable(Object instance)
Produce printable stringly representation of class layout. This method accepts instance to read the actual data from.

Parameters:
instance - instance to work on
Returns:
human-readable layout info


Copyright © 2013. All Rights Reserved.