railo.commons.lang
Class SizeOf

java.lang.Object
  extended by railo.commons.lang.SizeOf

public class SizeOf
extends Object

Calculation of object size.


Field Summary
static int BOOLEAN_SIZE
           
static int BYTE_SIZE
           
static int CHAR_SIZE
           
static int DOUBLE_SIZE
           
static int FLOAT_SIZE
           
static int HEADER_SIZE
           
static int INT_SIZE
           
static int LONG_SIZE
           
static int OBJECT_GRANULARITY_IN_BYTES
           
static int REF_SIZE
           
static int SHORT_SIZE
           
static int WORD_SIZE
           
 
Constructor Summary
SizeOf()
           
 
Method Summary
static long size(boolean value)
           
static long size(long value)
           
static long size(Object object)
           
static long size(Object object, int maxDepth)
           
static long size2(Object o)
          Calculates the size of an object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_GRANULARITY_IN_BYTES

public static final int OBJECT_GRANULARITY_IN_BYTES
See Also:
Constant Field Values

WORD_SIZE

public static final int WORD_SIZE

HEADER_SIZE

public static final int HEADER_SIZE

DOUBLE_SIZE

public static final int DOUBLE_SIZE
See Also:
Constant Field Values

FLOAT_SIZE

public static final int FLOAT_SIZE
See Also:
Constant Field Values

LONG_SIZE

public static final int LONG_SIZE
See Also:
Constant Field Values

INT_SIZE

public static final int INT_SIZE
See Also:
Constant Field Values

SHORT_SIZE

public static final int SHORT_SIZE
See Also:
Constant Field Values

BYTE_SIZE

public static final int BYTE_SIZE
See Also:
Constant Field Values

BOOLEAN_SIZE

public static final int BOOLEAN_SIZE
See Also:
Constant Field Values

CHAR_SIZE

public static final int CHAR_SIZE
See Also:
Constant Field Values

REF_SIZE

public static final int REF_SIZE
Constructor Detail

SizeOf

public SizeOf()
Method Detail

size2

public static long size2(Object o)
Calculates the size of an object.

Parameters:
object - the object that we want to have the size calculated.
Returns:
the size of the object or 0 if null.

size

public static long size(Object object)

size

public static long size(Object object,
                        int maxDepth)

size

public static long size(long value)

size

public static long size(boolean value)


Copyright © 2012 Railo