Class VectorFileIterators.IntVectorFileIterator

java.lang.Object
uk.co.parnmatt.vector.util.PrefetchingIterator<int[]>
uk.co.parnmatt.vector.reader.VectorFileIterators.IntVectorFileIterator
All Implemented Interfaces:
AutoCloseable, Iterator<int[]>, Resource<IOException>, Resource.Iterator<int[], IOException>
Enclosing class:
VectorFileIterators

public static final class VectorFileIterators.IntVectorFileIterator extends PrefetchingIterator<int[]>
Represents an iterator of int vector from a file
  • Constructor Details

    • IntVectorFileIterator

      public IntVectorFileIterator(Path path, Options options) throws IOException
      Parameters:
      path - the path to the file which to read
      options - the options to configure the read buffer
      Throws:
      IOException
  • Method Details

    • componentBytes

      protected int componentBytes()
      Returns:
      number of bytes of the array component representation
    • get

      protected int[] get(int dimensions, ByteBuffer buffer)
      Get a vector of the provided dimensions read from buffer
      Parameters:
      dimensions - the dimensions of the vector
      buffer - the buffer holding the raw vector data
      Returns:
      the vector of provided dimensions
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Resource<E>
      Throws:
      IOException
    • fetch

      protected int[] fetch()
      Specified by:
      fetch in class PrefetchingIterator<E>
      Returns:
      the next element in the iteration, or null to indicate the end of the iterator