Class FieldSortedListTrimmer


  • public class FieldSortedListTrimmer
    extends Object
    A trimmer for externally stored chronologically sorted lists.
    Since:
    12.1
    Author:
    Evan Ward, Vincent Cucchietti
    • Constructor Detail

      • FieldSortedListTrimmer

        public FieldSortedListTrimmer​(int neighborsSize)
        Create a new cache with the given neighbors size and data.
        Parameters:
        neighborsSize - size of the list returned from getNeighborsSubList(FieldAbsoluteDate, List).
    • Method Detail

      • getNeighborsSubList

        public <T extends FieldTimeStamped<K>,​K extends CalculusFieldElement<K>> List<T> getNeighborsSubList​(FieldAbsoluteDate<K> central,
                                                                                                                   List<T> data)
        Get the entries surrounding a central date.

        If the central date is well within covered range, the returned array will be balanced with half the points before central date and half the points after it (depending on n parity, of course). If the central date is near the boundary, then the returned array will be unbalanced and will contain only the n earliest (or latest) entries. A typical example of the later case is leap seconds cache, since the number of leap seconds cannot be arbitrarily increased.

        Type Parameters:
        T - the type of data
        K - the type of the field elements
        Parameters:
        central - central date
        data - complete list of entries (must be chronologically sorted)
        Returns:
        entries surrounding the specified date (sublist of data)