JTemporal Home
Tutorial

net.sf.jtemporal
Interface CachedTimeSeries.MissingElementHandler<V>

Enclosing class:
CachedTimeSeries<V>

public static interface CachedTimeSeries.MissingElementHandler<V>

Reacts on missing elements.
Populates the CachedTimeSeries when data is requested.
There is only a single MissingElementHandler for each CachedTimeSeries.

Version:
$Id: CachedTimeSeries.java,v 1.13 2007/09/14 20:03:10 tabeck Exp $

Method Summary
 void populateElement(CachedTimeSeries<V> ts, Instant i)
          This method is called when get(Instant) is called on the timeseries and no value is found in the cache.
 

Method Detail

populateElement

void populateElement(CachedTimeSeries<V> ts,
                     Instant i)
This method is called when get(Instant) is called on the timeseries and no value is found in the cache.
At his point, it's up to the implementor to populate the timeseries with one or more entries, by calling CachedTimeSeries.putInCache(Instant, Object).
In a performance point of view, it's usually a good idea here to populate a little bit more than just the requested value, in order to reduce the underlying calls granularity.
Note: If there exist no value valid at the requested instant, then you should store a null value. This will cache the information that there is no entry for this instant.

Parameters:
ts - the CachedTimeSeries instance originating the call
i - the key whose no value is associated
See Also:
TimeSeries.get(Instant), CachedTimeSeries.putInCache(Instant, Object)

JTemporal Home
Tutorial