Class MeasurementCache<E>
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.measurement.probe.MeasurementCache<E>
-
- Type Parameters:
E
-
public class MeasurementCache<E> extends Object
CachesMeasurement
s, 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,
Measurement
s MAY NOT strongly reference their respective trigger.
-
-
Constructor Summary
Constructors Constructor Description MeasurementCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Measurement<E>
getLastMeasurement(Object trigger, MeasuringPoint<E> mp)
void
put(Measurement<E> m)
-
-
-
Method Detail
-
put
public void put(Measurement<E> m)
-
getLastMeasurement
public Measurement<E> getLastMeasurement(Object trigger, MeasuringPoint<E> mp)
- Parameters:
trigger
- the triggermp
- 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.
-
-