ehcache

net.sf.ehcache.pool
Interface SizeOfEngine

All Known Implementing Classes:
DefaultSizeOfEngine, DiskSizeOfEngine

public interface SizeOfEngine

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

Author:
Ludovic Orban

Method Summary
 SizeOfEngine copyWith(int maxDepth, boolean abortWhenMaxDepthExceeded)
          Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters
 Size sizeOf(Object key, Object value, Object container)
          Size an element
 

Method Detail

sizeOf

Size sizeOf(Object key,
            Object value,
            Object container)
Size an element

Parameters:
key - the key of the element
value - the value of the element
container - 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 traverse
abortWhenMaxDepthExceeded - 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

ehcache

Copyright 2001-2017, Terracotta, Inc.