jist.swans.misc
Class Sizeof

java.lang.Object
  extended by jist.swans.misc.Sizeof

public class Sizeof
extends java.lang.Object

Compute the static or dynamic size of a type or object.

Since:
SWANS1.0

Constructor Summary
Sizeof()
           
 
Method Summary
static int inst(boolean b)
          Return (dynamic) size of primitive.
static int inst(byte b)
          Return (dynamic) size of primitive.
static int inst(char c)
          Return (dynamic) size of primitive.
static int inst(double d)
          Return (dynamic) size of primitive.
static int inst(float f)
          Return (dynamic) size of primitive.
static int inst(int i)
          Return (dynamic) size of primitive.
static int inst(long l)
          Return (dynamic) size of primitive.
static int inst(java.lang.Object obj)
          Return (dynamic) size of object instance.
static int inst(short s)
          Return (dynamic) size of primitive.
static int type(java.lang.Class type)
          Return static size of non-primitive type (a class/structure).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sizeof

public Sizeof()
Method Detail

inst

public static int inst(boolean b)
Return (dynamic) size of primitive.

Parameters:
b - boolean
Returns:
sizeof(boolean)

inst

public static int inst(byte b)
Return (dynamic) size of primitive.

Parameters:
b - byte
Returns:
sizeof(byte)

inst

public static int inst(char c)
Return (dynamic) size of primitive.

Parameters:
c - char
Returns:
sizeof(char)

inst

public static int inst(short s)
Return (dynamic) size of primitive.

Parameters:
s - short
Returns:
sizeof(short)

inst

public static int inst(int i)
Return (dynamic) size of primitive.

Parameters:
i - int
Returns:
sizeof(int)

inst

public static int inst(long l)
Return (dynamic) size of primitive.

Parameters:
l - long
Returns:
sizeof(long)

inst

public static int inst(float f)
Return (dynamic) size of primitive.

Parameters:
f - float
Returns:
sizeof(float)

inst

public static int inst(double d)
Return (dynamic) size of primitive.

Parameters:
d - double
Returns:
sizeof(double)

inst

public static int inst(java.lang.Object obj)
Return (dynamic) size of object instance.

Parameters:
obj - object to size
Returns:
size of object

type

public static int type(java.lang.Class type)
Return static size of non-primitive type (a class/structure).

Parameters:
type - class or structure to compute size
Returns:
size of class or structure