org.gillius.realdb.model
Interface ElementReconstructor


public interface ElementReconstructor

ElementReconstructor

Author:
Jason Winnebeck

Method Summary
 ElementInterval getInterval(long[] times, java.lang.Object[] values, int currentIndex)
          Returns an ElementInterval representing the value of the element between values[currentIndex] and values[currentIndex+1].
 int getLookAheadDesired()
          Returns the number of future Records beyond the immediately following Record to make a proper ElementInterval.
 int getLookBehindDesired()
          Returns the number of previous Records needed to make a proper ElementInterval.
 

Method Detail

getLookBehindDesired

int getLookBehindDesired()
Returns the number of previous Records needed to make a proper ElementInterval.


getLookAheadDesired

int getLookAheadDesired()
Returns the number of future Records beyond the immediately following Record to make a proper ElementInterval.


getInterval

ElementInterval getInterval(long[] times,
                            java.lang.Object[] values,
                            int currentIndex)
Returns an ElementInterval representing the value of the element between values[currentIndex] and values[currentIndex+1]. The size of the given arrays is at least 2 + getLookBehindDesired() + getLookAheadDesired(), and the value of currentIndex will be at least the value of getLookBehindDesired(). At the start and end of a stream's values, the values array may contain nulls (the corresponding timestamps will be negative). However, at least always values[currentIndex] and values[currentIndex+1] will be defined.

This method must not be affected by any mutable state after construction. In other words, for a single instance, every call with the same inputs to this method should return an equivalent ElementInterval. This is so the reconstructors can be shared.

Parameters:
times - timestamps array corresponding directly to the values array, which must not be modified.
values - sampled values of the element at the given timestamps, which must not be modified.
currentIndex - index of the sample that is the start of the ElementInterval.
Returns:
non-null ElementInterval


Copyright © 2008-2010 Jason Winnebeck. All Rights Reserved.