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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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​(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 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