Class RowColPositionCache


  • public class RowColPositionCache
    extends Object
    Simple positions cache
    • Constructor Detail

      • RowColPositionCache

        public RowColPositionCache()
        Constructor
    • Method Detail

      • getMaxIndex

        public Integer getMaxIndex()
        Get max cached row/column index
        Returns:
        max cached row/column index
      • getMinIndex

        public Integer getMinIndex()
        Get min cached row/column index
        Returns:
        min cached row/column index
      • setRowColPositionCache

        public void setRowColPositionCache​(int rowCol,
                                           int position)
        Put position of specified row/column to cache
        Parameters:
        rowCol - - row/column index
        position - - row/column begin position
      • getRowColPositionCache

        public Integer getRowColPositionCache​(int rowCol)
        Get position of specified row/column from cache
        Parameters:
        rowCol - - row/column index
        Returns:
        position of specified row/column or null if not cached yet
      • clearCacheFromRowCol

        public void clearCacheFromRowCol​(int rowCol)
        Clear positions cache from specified row/column index
        Parameters:
        rowCol - = row/column index
      • clearCache

        public void clearCache()
        Clear cache
      • getSortedKeysCollection

        public Collection<Integer> getSortedKeysCollection()
        Get sorted collection of cached values' keys
        Returns:
        sorted collection of cached values' keys
      • floorIndex

        public Integer floorIndex​(int rowColIndex)
        Get maximal cached row/column index less than specified row/column index
        Parameters:
        rowColIndex - - row/column index
        Returns:
        maximal cached row/column index less than specified row/column index or null if not found
      • highIndex

        public Integer highIndex​(int rowColIndex)
        Get minimal cached row/column index greater than specified row/column index
        Parameters:
        rowColIndex - - row/column index
        Returns:
        maximal cached row/column index less than specified row/column index or null if not found