Package psiprobe.tools
Class Instruments
- java.lang.Object
-
- psiprobe.tools.Instruments
-
public class Instruments extends Object
The Class Instruments.
-
-
Field Summary
Fields Modifier and Type Field Description private static Accessor
ACCESSOR
The Constant ACCESSOR.private ClassLoader
classLoader
The class loader.private static boolean
IGNORE_NIO
The Constant IGNORE_NIO.private List<Object>
nextQueue
The next queue.private Set<Object>
processedObjects
The processed objects.static long
SIZE_BOOLEAN
The Constant SIZE_BOOLEAN.static long
SIZE_BYTE
The Constant SIZE_BYTE.static long
SIZE_CHAR
The Constant SIZE_CHAR.static long
SIZE_DOUBLE
The Constant SIZE_DOUBLE.static long
SIZE_FLOAT
The Constant SIZE_FLOAT.static long
SIZE_INT
The Constant SIZE_INT.static long
SIZE_LONG
The Constant SIZE_LONG.static long
SIZE_OBJECT
The Constant SIZE_OBJECT.static long
SIZE_REFERENCE
The Constant SIZE_REFERENCE.static long
SIZE_SHORT
The Constant SIZE_SHORT.static long
SIZE_VOID
The Constant SIZE_VOID.private List<Object>
thisQueue
The this queue.
-
Constructor Summary
Constructors Constructor Description Instruments()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Field
findField(Class<T> clazz, String name)
Find field.static Object
getField(Object obj, String name)
Gets the field.private long
internalSizeOf(Object root)
Internal size of.static boolean
isInitialized()
Checks if is initialized.static long
sizeOf(Object obj)
Size of.static long
sizeOf(Object obj, ClassLoader cl)
Size of.static long
sizeOf(Object obj, Set<Object> objects)
Size of.private long
sizeOfArray(Object obj)
Size of array.private long
sizeOfObject(Object obj)
Size of object.private static <T> long
sizeOfPrimitive(Class<T> type)
Size of primitive.
-
-
-
Field Detail
-
SIZE_VOID
public static final long SIZE_VOID
The Constant SIZE_VOID.- See Also:
- Constant Field Values
-
SIZE_BOOLEAN
public static final long SIZE_BOOLEAN
The Constant SIZE_BOOLEAN.- See Also:
- Constant Field Values
-
SIZE_BYTE
public static final long SIZE_BYTE
The Constant SIZE_BYTE.- See Also:
- Constant Field Values
-
SIZE_CHAR
public static final long SIZE_CHAR
The Constant SIZE_CHAR.- See Also:
- Constant Field Values
-
SIZE_SHORT
public static final long SIZE_SHORT
The Constant SIZE_SHORT.- See Also:
- Constant Field Values
-
SIZE_INT
public static final long SIZE_INT
The Constant SIZE_INT.- See Also:
- Constant Field Values
-
SIZE_LONG
public static final long SIZE_LONG
The Constant SIZE_LONG.- See Also:
- Constant Field Values
-
SIZE_FLOAT
public static final long SIZE_FLOAT
The Constant SIZE_FLOAT.- See Also:
- Constant Field Values
-
SIZE_DOUBLE
public static final long SIZE_DOUBLE
The Constant SIZE_DOUBLE.- See Also:
- Constant Field Values
-
SIZE_OBJECT
public static final long SIZE_OBJECT
The Constant SIZE_OBJECT.- See Also:
- Constant Field Values
-
SIZE_REFERENCE
public static final long SIZE_REFERENCE
The Constant SIZE_REFERENCE.
-
ACCESSOR
private static final Accessor ACCESSOR
The Constant ACCESSOR.
-
IGNORE_NIO
private static final boolean IGNORE_NIO
The Constant IGNORE_NIO.
-
classLoader
private ClassLoader classLoader
The class loader.
-
-
Method Detail
-
sizeOf
public static long sizeOf(Object obj)
Size of.- Parameters:
obj
- the obj- Returns:
- the long
-
sizeOf
public static long sizeOf(Object obj, ClassLoader cl)
Size of.- Parameters:
obj
- the objcl
- the cl- Returns:
- the long
-
sizeOf
public static long sizeOf(Object obj, Set<Object> objects)
Size of.- Parameters:
obj
- the objobjects
- the objects- Returns:
- the long
-
internalSizeOf
private long internalSizeOf(Object root)
Internal size of.- Parameters:
root
- the root- Returns:
- the long
-
sizeOfObject
private long sizeOfObject(Object obj)
Size of object.- Parameters:
obj
- the obj- Returns:
- the long
-
sizeOfArray
private long sizeOfArray(Object obj)
Size of array.- Parameters:
obj
- the obj- Returns:
- the long
-
sizeOfPrimitive
private static <T> long sizeOfPrimitive(Class<T> type)
Size of primitive.- Type Parameters:
T
- the generic type- Parameters:
type
- the type- Returns:
- the long
-
isInitialized
public static boolean isInitialized()
Checks if is initialized.- Returns:
- true, if is initialized
-
getField
public static Object getField(Object obj, String name)
Gets the field.- Parameters:
obj
- the objname
- the name- Returns:
- the field
-
-