Class PrimitiveEntrySizeCalculator

  • All Implemented Interfaces:
    EntrySizeCalculator<java.lang.Object,​java.lang.Object>

    public class PrimitiveEntrySizeCalculator
    extends AbstractEntrySizeCalculatorHelper<java.lang.Object,​java.lang.Object>
    Entry Size calculator that returns an approximation of how much various primitives, primitive wrappers, Strings, and arrays
    Since:
    8.0
    Author:
    wburns
    • Constructor Detail

      • PrimitiveEntrySizeCalculator

        public PrimitiveEntrySizeCalculator()
    • Method Detail

      • calculateSize

        public long calculateSize​(java.lang.Object key,
                                  java.lang.Object value)
        Description copied from interface: EntrySizeCalculator
        Method used to calculate how much memory in size the key and value use.
        Parameters:
        key - The key for this entry to be used in size calculation
        value - The value for this entry to be used in size calculation
        Returns:
        The size approximately in memory the key and value use
      • handleObject

        protected long handleObject​(java.lang.Object object)