Top Description Methods
net.sf.ehcache.pool

public Interface SizeOfEngine

Known Direct Implementers
net.sf.ehcache.pool.impl.DefaultSizeOfEngine, net.sf.ehcache.store.disk.DiskSizeOfEngine

SizeOf engines are used to calculate the size of elements stored in poolable stores.
Author
Ludovic Orban

Method Summary

Modifier and TypeMethod and Description
public SizeOfEngine

Returns:

a copy of the SizeOf engine using the specified parameters
copyWith
(int
maximum depth of the object graph to traverse
maxDepth
,
boolean
true if the object traversal should be aborted when the max depth is exceeded
abortWhenMaxDepthExceeded
)

Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters

public Size

Returns:

the size of the element in bytes
sizeOf
(Object
the key of the element
key
,
Object
the value of the element
value
,
Object
the container of the element, ie: element object + eventual overhead
container
)

Size an element

Method Detail

copyWithback to summary
public SizeOfEngine copyWith(int maxDepth, boolean abortWhenMaxDepthExceeded)

Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters

Parameters
maxDepth:int

maximum depth of the object graph to traverse

abortWhenMaxDepthExceeded:boolean

true if the object traversal should be aborted when the max depth is exceeded

Returns:SizeOfEngine

a copy of the SizeOf engine using the specified parameters

sizeOfback to summary
public Size sizeOf(Object key, Object value, Object container)

Size an element

Parameters
key:Object

the key of the element

value:Object

the value of the element

container:Object

the container of the element, ie: element object + eventual overhead

Returns:Size

the size of the element in bytes