Class IndexWriter.IntArray1NWriter

    • Constructor Detail

      • IntArray1NWriter

        public IntArray1NWriter​(int size,
                                File indexFile)
                         throws IOException
        Construct a writer of the required size.
        Parameters:
        size - the number of entries
        indexFile - the file to be written to
        Throws:
        IOException - if there is a problem writing the file
    • Method Detail

      • log

        public void log​(IndexWriter.Identifier identifier,
                        int index,
                        ArrayLong references)
                 throws IOException
        Used to record the addresses as IDs.
        Parameters:
        identifier - used to map references to IDs
        index - the index associated with these references
        references - the references (should be in identifier otherwise ignored)
        Throws:
        IOException - if there is a problem writing the data
      • log

        public void log​(IIndexReader.IOne2LongIndex identifier,
                        int index,
                        ArrayLong references)
                 throws IOException
        Used to record the addresses as IDs. Sorts the references in order (except the first) and removes duplicates.
        Parameters:
        identifier - used to map references to IDs
        index - the index associated with these references
        references - the references (should be in identifier otherwise ignored)
        Throws:
        IOException - if there is a problem writing the data
        Since:
        1.2
      • log

        public void log​(int index,
                        int[] values)
                 throws IOException
        must not contain duplicates!
        Throws:
        IOException
      • cancel

        public void cancel()
        Terminate the IntArray1NWriter and delete any file which has been written so far. Use to cancel part way through.
      • getIndexFile

        public File getIndexFile()
        Get the index file.
        Returns:
        the file