Class IndexReader.SizeIndexReader

    • Constructor Detail

      • SizeIndexReader

        public SizeIndexReader​(File indexFile)
                        throws IOException
        Constructor used when reopening a dump
        Parameters:
        indexFile - the file holding the index
        Throws:
        IOException - if there was a problem reading the file
      • SizeIndexReader

        public SizeIndexReader​(IIndexReader.IOne2OneIndex idx)
        Construct a size index reader based on a int index holding the compressed data
        Parameters:
        idx - the source index
    • Method Detail

      • getSize

        public long getSize​(int index)
        Expand the compressed size.
        Specified by:
        getSize in interface IIndexReader.IOne2SizeIndex
        Parameters:
        index - the encoded compressed size
        Returns:
        the actual size in bytes
      • get

        public int get​(int index)
        Get the (compressed) size. Delegate to the int index.
        Specified by:
        get in interface IIndexReader.IOne2OneIndex
        Parameters:
        index - the index of the object
        Returns:
        the encoded compressed size
      • getAll

        public int[] getAll​(int[] index)
        Delegate to the int index. Gets the encoded sizes for a list of object IDs
        Specified by:
        getAll in interface IIndexReader.IOne2OneIndex
        Parameters:
        index - an array of items to look up
        Returns:
        an array of the result items
      • getNext

        public int[] getNext​(int index,
                             int length)
        Delegate to the int index. Gets the encoded sizes for a consecutive list of object IDs
        Specified by:
        getNext in interface IIndexReader.IOne2OneIndex
        Parameters:
        index - the starting index
        length - the number to read
        Returns:
        an array of compressed sizes
      • delete

        public void delete()
        Delegate to the int index.
        Specified by:
        delete in interface IIndexReader
      • size

        public int size()
        Delegate to the int index.
        Specified by:
        size in interface IIndexReader
        Returns:
        the number of entries