Class PageUtils


  • public class PageUtils
    extends Object
    Utility methods for working with (fixed-size) pages.
    Author:
    raven
    • Constructor Detail

      • PageUtils

        public PageUtils()
    • Method Detail

      • getPageIndexForOffset

        public static long getPageIndexForOffset​(long offset,
                                                 long pageSize)
      • getIndexInPage

        public static long getIndexInPage​(long offset,
                                          long pageSize)
      • getIndexInPage

        public static int getIndexInPage​(long offset,
                                         int pageSize)
      • getPageOffsetForId

        public static long getPageOffsetForId​(long pageId,
                                              long pageSize)
      • touchedPageIndices

        public static java.util.stream.LongStream touchedPageIndices​(com.google.common.collect.Range<Long> range,
                                                                     long pageSize)
        Return a stream of the page indices touched by the range w.r.t. the page size
      • touchedPageIndices

        public static NavigableSet<Long> touchedPageIndices​(Collection<com.google.common.collect.Range<Long>> ranges,
                                                            long pageSize)