Package org.github.jamm
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 TypeMethodDescriptionvoid
addChildrenTo
(MeasurementStack stack) Adds the children that should be part of the measurement to the stackdefault long
shallowSize
(MemoryMeterStrategy strategy) Allow the implementation to pre-compute and cache theMeasurable
shallow size.
-
Method Details
-
shallowSize
Allow the implementation to pre-compute and cache theMeasurable
shallow size.- Parameters:
strategy
- theMemoryMeterStrategy
- Returns:
- the object shallow size
-
addChildrenTo
Adds the children that should be part of the measurement to the stack- Parameters:
stack
- the stack to which the children must be added
-