|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.util.cache.CacheSizes
public class CacheSizes
Utility class for determining the sizes in bytes of commonly used objects. Classes implementing the Cacheable interface should use this class to determine their size.
Constructor Summary | |
---|---|
CacheSizes()
|
Method Summary | |
---|---|
static int |
sizeOfAnything(Object object)
Returns the size of an object in bytes. |
static int |
sizeOfBoolean()
Returns the size in bytes of a primitive boolean. |
static int |
sizeOfChar()
Returns the size in bytes of a primitive char. |
static int |
sizeOfCollection(Collection list)
Returns the size in bytes of a Collection object. |
static int |
sizeOfDate()
Returns the size in bytes of a Date. |
static int |
sizeOfDouble()
Returns the size in bytes of a primitive double. |
static int |
sizeOfInt()
Returns the size in bytes of a primitive int. |
static int |
sizeOfLong()
Returns the size in bytes of a primitive long. |
static int |
sizeOfMap(Map map)
Returns the size in bytes of a Map object. |
static int |
sizeOfObject()
Returns the size in bytes of a basic Object. |
static int |
sizeOfString(String string)
Returns the size in bytes of a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheSizes()
Method Detail |
---|
public static int sizeOfObject()
public static int sizeOfString(String string)
string
- the String to determine the size of.
public static int sizeOfInt()
public static int sizeOfChar()
public static int sizeOfBoolean()
public static int sizeOfLong()
public static int sizeOfDouble()
public static int sizeOfDate()
public static int sizeOfMap(Map map) throws CannotCalculateSizeException
map
- the Map object to determine the size of.
CannotCalculateSizeException
public static int sizeOfCollection(Collection list) throws CannotCalculateSizeException
list
- the Collection object to determine the size of.
CannotCalculateSizeException
public static int sizeOfAnything(Object object) throws CannotCalculateSizeException
CannotCalculateSizeException
|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |