Class IndexWriter.LongIndexStreamer

  • Enclosing class:
    IndexWriter

    public static class IndexWriter.LongIndexStreamer
    extends java.lang.Object
    A helper class to output a list of longs.
    • Constructor Detail

      • LongIndexStreamer

        public LongIndexStreamer()
        A simple constructor.
      • LongIndexStreamer

        public LongIndexStreamer​(java.io.File indexFile)
                          throws java.io.IOException
        Construct a streamer which outputs to a file
        Parameters:
        indexFile - the output file
        Throws:
        java.io.IOException - if a problem occurs with a write
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Close the backing file.
        Throws:
        java.io.IOException - if a problem occurs with the write or close.
      • writeTo

        public IIndexReader.IOne2LongIndex writeTo​(java.io.File indexFile,
                                                   long[] array)
                                            throws java.io.IOException
        Output a whole long array
        Parameters:
        indexFile - the output file
        array - the source data
        Returns:
        a reader for the data
        Throws:
        java.io.IOException - if a problem occurred with the write
      • writeTo

        public IIndexReader.IOne2LongIndex writeTo​(java.io.File indexFile,
                                                   IteratorLong iterator)
                                            throws java.io.IOException
        Output a whole long iterator
        Parameters:
        indexFile - the output file
        iterator - the source data
        Returns:
        a reader for the data
        Throws:
        java.io.IOException - if a problem occurred with the write
      • writeTo

        public IIndexReader.IOne2LongIndex writeTo​(java.io.File indexFile,
                                                   ArrayLong array)
                                            throws java.io.IOException
        Output a whole ArrayLong
        Parameters:
        indexFile - the output file
        array - the source data
        Returns:
        a reader for the data
        Throws:
        java.io.IOException - if a problem occurred with the write
      • addAll

        public void addAll​(IteratorLong iterator)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • addAll

        public void addAll​(ArrayLong array)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • add

        public void add​(long value)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • addAll

        public void addAll​(long[] values)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • addAll

        public void addAll​(long[] values,
                           int offset,
                           int length)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • get

        public long get​(int index)
      • getNext

        public long[] getNext​(int index,
                              int length)
      • reverse

        public int reverse​(long value)
      • set

        public void set​(int index,
                        long value)
      • unload

        public void unload()
      • size

        public int size()