Class VectorFileIterators.LongVectorFileIterator
java.lang.Object
uk.co.parnmatt.vector.util.PrefetchingIterator<long[]>
uk.co.parnmatt.vector.reader.VectorFileIterators.LongVectorFileIterator
- All Implemented Interfaces:
AutoCloseable, Iterator<long[]>, Resource<IOException>, Resource.Iterator<long[], IOException>
- Enclosing class:
VectorFileIterators
public static final class VectorFileIterators.LongVectorFileIterator
extends PrefetchingIterator<long[]>
Represents an iterator of
long vector from a file-
Nested Class Summary
Nested classes/interfaces inherited from interface Resource
Resource.Iterable<T,X>, Resource.Iterator<E, X> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected intprotected long[]fetch()protected long[]get(int dimensions, ByteBuffer buffer) Get a vector of the provided dimensions read from bufferMethods inherited from class PrefetchingIterator
hasNext, nextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, hasNext, next, remove
-
Constructor Details
-
LongVectorFileIterator
- Parameters:
path- the path to the file which to readoptions- 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
Get a vector of the provided dimensions read from buffer- Parameters:
dimensions- the dimensions of the vectorbuffer- the buffer holding the raw vector data- Returns:
- the vector of provided dimensions
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResource<E>- Throws:
IOException
-
fetch
protected long[] fetch()- Specified by:
fetchin classPrefetchingIterator<E>- Returns:
- the next element in the iteration, or
nullto indicate the end of the iterator
-