Class SortedListTrimmer

  • public class SortedListTrimmer
    extends Object
    A trimmer for externally stored chronologically sorted lists.
    Evan Ward
    • Constructor Detail

      • SortedListTrimmer

        public SortedListTrimmer​(int neighborsSize)
        Create a new trimmer with the given neighbors size.
        neighborsSize - size of the list returned from getNeighborsSubList(AbsoluteDate, List)
    • Method Detail

      • getNeighborsSubList

        public <T extends TimeStampedList<T> getNeighborsSubList​(AbsoluteDate 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
        central - central date
        data - complete list of entries (must be chronologically sorted)
        entries surrounding the specified date (sublist of data)