Interface Measurable


public interface Measurable
Interface that allows users to avoid crawling via reflection by adding children manually to the stack, therefore speeding up the computation. The downside of this approach is that it pushes the responsibility to the user to ensure that all the children are provided.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the children that should be part of the measurement to the stack
    default long
    Allow the implementation to pre-compute and cache the Measurable shallow size.
  • Method Details

    • shallowSize

      default long shallowSize(MemoryMeterStrategy strategy)
      Allow the implementation to pre-compute and cache the Measurable shallow size.
      Parameters:
      strategy - the MemoryMeterStrategy
      Returns:
      the object shallow size
    • addChildrenTo

      void addChildrenTo(MeasurementStack stack)
      Adds the children that should be part of the measurement to the stack
      Parameters:
      stack - the stack to which the children must be added