Class ChunkedHashStore.Chunk
java.lang.Object
it.unimi.dsi.sux4j.io.ChunkedHashStore.Chunk
- All Implemented Interfaces:
Iterable<long[]>
- Enclosing class:
ChunkedHashStore<T>
A chunk returned by a
ChunkedHashStore.- Since:
- 1.0.4
- Author:
- Sebastiano Vigna
-
Constructor Summary
ConstructorsConstructorDescriptionChunk()Creates a chunk with all field set to zero or null.Chunk(ChunkedHashStore.Chunk chunk) Copy constructor for multi-threaded chunk analysis. -
Method Summary
Modifier and TypeMethodDescriptionlongdata(long k) Returns the data of thek-th triple returned by this chunk.intindex()The index of this chunk.Iterator<long[]> iterator()Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call.intsize()The number of triples in this chunk.it.unimi.dsi.fastutil.longs.LongBigListvalueList(it.unimi.dsi.fastutil.longs.LongIterable values) Commodity methods that exposes transparently either the data contained in the chunk, or the data obtained by using the chunk to index a list.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
Chunk
Copy constructor for multi-threaded chunk analysis.- Parameters:
chunk- a chunk to be copied.
-
Chunk
public Chunk()Creates a chunk with all field set to zero or null. Mainly useful to create marker objects.
-
-
Method Details
-
size
public int size()The number of triples in this chunk.- Returns:
- the number of triples in this chunk.
-
index
public int index()The index of this chunk.- Returns:
- the index of this chunk.
-
data
public long data(long k) Returns the data of thek-th triple returned by this chunk.This method provides an alternative random access to data (w.r.t. indexing the fourth element of the quadruples returned by
iterator()).- Parameters:
k- the index (in iteration order) of a triple.- Returns:
- the corresponding data.
-
iterator
Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call. -
valueList
public it.unimi.dsi.fastutil.longs.LongBigList valueList(it.unimi.dsi.fastutil.longs.LongIterable values) Commodity methods that exposes transparently either the data contained in the chunk, or the data obtained by using the chunk to index a list.- Parameters:
values- a list of values. Must be either an instance ofLongList, or an instance ofLongBigList. If it is notnull, the data in the chunk is used to index this list and return a value. Otherwise, the data in the chunk is returned directly.- Returns:
- a big list of longs representing the values associated with each element in the chunk.
-