Package net.sf.ehcache.store.disk
Class DiskSizeOfEngine
- java.lang.Object
-
- net.sf.ehcache.store.disk.DiskSizeOfEngine
-
- All Implemented Interfaces:
SizeOfEngine
public class DiskSizeOfEngine extends java.lang.Object implements SizeOfEngine
SizeOf engine which calculates exact usage of the disk store.- Author:
- Ludovic Orban
-
-
Constructor Summary
Constructors Constructor Description DiskSizeOfEngine()
-
Method Summary
All Methods Instance Methods Concrete 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
public Size sizeOf(java.lang.Object key, java.lang.Object value, java.lang.Object container)
Size an element- Specified by:
sizeOfin interfaceSizeOfEngine- 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
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- Specified by:
copyWithin interfaceSizeOfEngine- 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
-
-