Package com.complexible.common.base
Class SizeFunctions
java.lang.Object
com.complexible.common.base.SizeFunctions
Implementation of size computation for commonly used object types. The result will typically be an approximation
rather than an exact amount. Speed is more important than accuracy since this utility is primarily used to adjust the
number of elements in a cache.
- Version:
- 2.0
- Author:
- Evren Sirin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final SizeFunction<Long> static final SizeFunction<Number> WARNING: checks only for Long and Integer instances! Everything that is not a Long will be sized as if it is an Integer.static final intstatic final intstatic final SizeFunction<String> -
Method Summary
-
Field Details
-
OBJECT_OVERHEAD
public static final int OBJECT_OVERHEAD- See Also:
-
REF_OVERHEAD
public static final int REF_OVERHEAD- See Also:
-
ARRAY_OVERHEAD
public static final int ARRAY_OVERHEAD- See Also:
-
STRING
-
NUMBER
WARNING: checks only for Long and Integer instances! Everything that is not a Long will be sized as if it is an Integer. -
LONG
-
-
Method Details
-
constantSize
-