Class ChunkedHashStore.Chunk

java.lang.Object
it.unimi.dsi.sux4j.io.ChunkedHashStore.Chunk
All Implemented Interfaces:
Iterable<long[]>
Enclosing class:
ChunkedHashStore<T>

public static final class ChunkedHashStore.Chunk extends Object implements Iterable<long[]>
A chunk returned by a ChunkedHashStore.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a chunk with all field set to zero or null.
    Copy constructor for multi-threaded chunk analysis.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    data(long k)
    Returns the data of the k-th triple returned by this chunk.
    int
    The index of this chunk.
    Iterator<long[]>
    Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call.
    int
    The number of triples in this chunk.
    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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • Chunk

      public Chunk(ChunkedHashStore.Chunk 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 the k-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

      public Iterator<long[]> iterator()
      Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call.
      Specified by:
      iterator in interface Iterable<long[]>
      Returns:
      an iterator over quadruples formed by a triple (indices 0, 1, 2) and the associated data (index 3).
    • valueList

      public LongBigList valueList(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 of LongList, or an instance of LongBigList. If it is not null, 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.