Package net.sf.ehcache.pool
Interface SizeOfEngine
-
- All Known Implementing Classes:
DefaultSizeOfEngine,DiskSizeOfEngine
public interface SizeOfEngineSizeOf engines are used to calculate the size of elements stored in poolable stores.- Author:
- Ludovic Orban
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SizeOfEnginecopyWith(int maxDepth, boolean abortWhenMaxDepthExceeded)Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parametersSizesizeOf(java.lang.Object key, java.lang.Object value, java.lang.Object container)Size an element
-
-
-
Method Detail
-
sizeOf
Size sizeOf(java.lang.Object key, java.lang.Object value, java.lang.Object container)
Size an element- Parameters:
key- the key of the elementvalue- the value of the elementcontainer- the container of the element, ie: element object + eventual overhead- Returns:
- the size of the element in bytes
-
copyWith
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- maximum depth of the object graph to traverseabortWhenMaxDepthExceeded- true if the object traversal should be aborted when the max depth is exceeded- Returns:
- a copy of the SizeOf engine using the specified parameters
-
-