Class MeasurementCache<E>

  • Type Parameters:
    E -

    public class MeasurementCache<E>
    extends Object
    Caches Measurements, at most one entry--the most recent one--per (trigger, MeasuringPoint)-pair.

    Entries whose trigger have been garbage-collected, will be automatically evicted from the cache. For this to work, Measurements MAY NOT strongly reference their respective trigger.

    • Constructor Detail

      • MeasurementCache

        public MeasurementCache()
    • Method Detail

      • getLastMeasurement

        public Measurement<E> getLastMeasurement​(Object trigger,
                                                 MeasuringPoint<E> mp)
        Parameters:
        trigger - the trigger
        mp - the measuring point
        Returns:
        the requested measurement, or null, if no such measurement can be found because it has been evicted from the cache already, or because no such measurement has been added before.